while (line = gets)
    str = line.chomp
    status = 0
    uns = ""
    num = 0
    str.each_char do |ch|
        case status
        when 0 then
            if ch == "@"
                status = 1
            else
                uns += ch
            end
        when 1 then
            num = ch.to_i
            status = 2
        when 2 then
            num.times {uns += ch}
            status = 0
        end
    end

    puts uns
end

