Problem:


ランレングス

文字列が連続した場合、ある規則で文字を置き換え文字列を短くすることができます。たとえば、AAAA という文字列の場合、@4A と表現すれば 1 文字分圧縮されます。この規則で圧縮された文字列を入力してもとの文字列に復元するプログラムを作成してください。ただし、復元した文字列に＠文字は出現しないものとします。

また、原文の文字列は英大文字、英小文字、数字、記号であり 100 文字以内、連続する文字は 9 文字以内です。

入力

複数の文字列が与えられます。１行に１つの文字列が与えられます。文字列の数は 50 を超えません。

出力

文字列ごとに、各文字に対して復元した文字列を１行に出力して下さい。

Sample Input

ab@5C1@8050
@99+1=1@90

Output for the Sample Input

abCCCCC10000000050
999999999+1=1000000000



Sample input:
ab@5C1@8050
@99+1=1@90


Sample output:
abCCCCC10000000050
999999999+1=1000000000

Submission status: Wrong Answer

Solution code:
while True:
    try:
        s = raw_input()
    except EOFError:
        break
        
    i=0
    hirabun = ''
    while i < len(s):
        if s[i] != '@':
            hirabun += s[i]
            i += 1
        elif s[i] == '@':
            hira_part = s[i+2]*int(s[i+1])
            hirabun += hira_part
            i += 1 
    print hirabun

Submission status: Wrong Answer

Solution code:
while True:
    try:
        s = raw_input()
    except EOFError:
        break
        
    i=0
    hirabun = ''
    while i+2 <= len(s):
        if s[i] != '@':
            i += 1
        elif s[i] == '@':
            hira_part = s[i+2]*int(s[i+1])
            hirabun += hira_part
            i += 1 
    print hirabun

Submission status: Wrong Answer

Solution code:
import sys
if __name__=="__main__":
    st=raw_input()
    ans=[]
    for i,e in enumerate(st):
        if e=='@':
            for j in range(1,int(st[i+1])):
                ans.append(st[i+2])
        else :
            if st[i-1]!='@':
                ans.append(e)
    for e in ans:
        sys.stdout.write(e)
    print ""

Submission status: Wrong Answer

Solution code:
while True:
	try:
		line=list(map(str,input()))
		string=""
		for i in range(len(line)):
			if (line[i]!='@' and line[i-1]!='@'):
				string+=line[i]
			elif line[i]=='@':
				string+=line[i+2]*int(line[i+1])
			else:
				pass
		print(string)
	except EOFError:
		break

Submission status: Wrong Answer

Solution code:
while 1:
    try:
        s=raw_input()
        n=len(s)
        ns=""
        for i in xrange(n):
            if s[i]=="@" and i!=n-2:
                ns+=int(s[i+1])*s[i+2]
            else:
                ns+=s[i]
        print(ns)
    except:
        break

Submission status: Wrong Answer

Solution code:
import sys

for line in sys.stdin:
    line = line.strip()
    i = 0
    ans = ""
    while i < len(line):
        if line[i] == "@":
            m = int(line[i+1])
            c = line[i+2]
            i += 2
            ans += m*c
        else:
            ans += line[i]
            i += 1
    print(ans)

Submission status: Wrong Answer

Solution code:
while True:
    try:
        string = input()
    except:
        break
    ans = ""
    for i in range(len(string)):
        if string[i] == "@":
            ans += int(string[i+1])*string[i+2]
        else:
            ans += string[i]
    print(ans)

Submission status: Wrong Answer

Solution code:
import sys
def main():
    for line in sys.stdin:
        a = list(line)
        del a[-1]

        n = [str(i) for i in range(10)]
        uc = [chr(i) for i in range(65, 65 + 26)]
        lc = [chr(i) for i in range(97, 97 + 26)]
        sym = ["!" ,"#", "$", "%", "&",\
                "/", "(", ")", "*", "+",\
                 "-", ".", "\"", "\'", "^",\
                 "[", "]", ":", ";", "<", ">",\
                 "=", "?", "_", "~", "|", "~",\
                 "{", "}", "`"]

        b = []
        for x in range(len(a)):
            if a[x] in n or\
                a[x] in uc or\
                 a[x] in lc or\
                 a[x] in sym:
                b.append(a[x])
            elif a[x] == "@":
                for _ in range(int(a[x + 1])):
                    b.append(a[x + 2])
                if x + 3 >= len(a):
                    break
                else:
                    x += 3
        else:
            ans = ""
            for x in range(len(b)):
                ans += b[x]
            print(ans)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import sys
for inp in sys.stdin:
    msg = ""
    for i in range(len(inp)):
        if inp[i] == "@": msg += inp[i+2]*int(inp[i+1])
        else: msg += inp[i]
    print msg

Submission status: Wrong Answer

Solution code:
while True:
    try:
        inp = raw_input()
        msg = ""
        for i in range(len(inp)):
            if msg[i] == "@":
                msg += inp[i+2]*int(inp[i+1])
            else:
                msg += inp[i]
        print msg
    except:
        break

Submission status: Wrong Answer

Solution code:
while True:
    try:
        inp = raw_input()
        i, msg = 0, ""
        while i < len(inp)-1:
            if inp[i] == "@":
                msg += inp[i+2]*int(inp[i+1])
                i += 3
            else:
                msg += inp[i]
                i += 1
        print msg
    except:
        break

Submission status: Wrong Answer

Solution code:
while True:
	try:
		char = raw_input()
		ans = ""
		while "@" in char:
			ans += char[0:char.index("@")]
			char = char[char.index("@"):]
			char = char[2] * int(char[1]) + char[3:]
		ans += char
	except:
		break

Submission status: Accepted

Solution code:
import sys
for line in sys.stdin:
    appendStrs = []
    line = line.strip()
    for i in range(0, len(line) ) :
        if line[i] == "@" :
            appendStrs.append((line[i:i+3], "".join([ line[i+2] for _ in range(0, int(line[i+1]) )]))) ;
    for a in appendStrs :
        line = line.replace(*a, 1)
    print(line)

Submission status: Accepted

Solution code:
import re
import sys
for s in sys.stdin:
    print(re.sub(r"@(\d)(.)", lambda m: m.group(2)*int(m.group(1)), s.rstrip()))

Submission status: Accepted

Solution code:
import sys

for s in sys.stdin:
    out = ""
    i = 0
    while True:
        if i > len(s)-2 :
            break
        if s[i] == "@":
            out += s[i+2]*int(s[i+1])
            i += 2
        else:
            out += s[i]
        i += 1
    print out

Submission status: Accepted

Solution code:
import sys


def method(l):
    idx = l.find('@')
    return l if idx < 0 else method(l.replace(l[idx:idx+3], l[idx+2]*int(l[idx+1])))

for line in sys.stdin:
    print(method(line.replace('\n', '')))

Submission status: Accepted

Solution code:
import sys
f = sys.stdin

for line in f:
    line = line.strip()
    index = line.find('@')
    while index != -1:
        target = line[index:index + 3]
        line = line.replace(target, target[2] * int(target[1]))
        index = line.find('@')
    print(line)

Submission status: Accepted

Solution code:
while True:
    try:
        data=raw_input()
        original=''
        i=0
        while True:
            if data[i]=='@':
                original+=int(data[i+1])*data[i+2]
                i+=2
            else:
                original+=data[i]
            i+=1
            if len(data)<=i:
                break
        print original
    except:
        break

Submission status: Accepted

Solution code:
while True:
    try:
        s = raw_input()
    except EOFError:
        break
        
    i=0
    hirabun = ''
    while i <len(s):
        if s[i] != '@':
            hirabun += s[i]
            i += 1
        elif s[i] == '@' and i+2 < len(s):
            hira_part = s[i+2]*int(s[i+1])
            hirabun += hira_part
            i += 3 
    print hirabun

Submission status: Accepted

Solution code:
from math import *
PI = 3.1415926535898
while True:
    try:
        s = raw_input()
        i = 0
        ans = ""
        while i < len(s):
            if s[i] == '@':
                d = int(s[i+1])
                for x in range(d):
                    ans += s[i+2]
                i += 3
            else:
                ans += s[i]
                i += 1
        print ans
    except EOFError:
        break

Submission status: Accepted

Solution code:
while 1:
    try:
        n=raw_input()
        ans=''
        f=t=0
        for i in n:
            if i!='@' and f==0:
                ans+=i
            elif i=='@':
                f=1
            elif f==1 and t==0:
                t=int(i)
            else:
                ans+=i*t
                f=0
                t=0
        print ans

    except:
        break
exit()

Submission status: Accepted

Solution code:
import sys
if __name__=="__main__":
    while True:
        try:
            st=raw_input()
            ans=[]
            for i,e in enumerate(st):
                if e=='@':
                    for j in range(1,int(st[i+1])):
                        ans.append(st[i+2])
                else :
                    if st[i-1]!='@':
                        ans.append(e)
            for e in ans:
                sys.stdout.write(e)
            print ""
        except EOFError: break

Submission status: Accepted

Solution code:
while True:
	try:
		line=list(map(str,input()))
		string=""
		for i in range(len(line)):
			if (line[i]!='@' and line[i-1]!='@' and line[i-2]!='@'):
				string+=line[i]
			elif line[i]=='@':
				string+=line[i+2]*int(line[i+1])
			else:
				pass
		print(string)
	except EOFError:
		break

Submission status: Accepted

Solution code:
while 1:
    try:
        s=raw_input()
        n=len(s)
        ns=""
        i=0
        while i<=n-1:
            if s[i]=="@" and i!=n-2:
                ns+=int(s[i+1])*s[i+2]
                i+=3
            else:
                ns+=s[i]
                i+=1
        print(ns)
    except:
        break

Submission status: Accepted

Solution code:
while True:
    try:
        cha = input()
        cha = list(cha)
        ans = ""
        i = 0
        while i < len(cha):
            if cha[i] == "@":
                n = int(cha[i + 1])
                moji = cha[i + 2]
                for j in range(n):
                    ans += moji
                i += 3
            else:
                ans += cha[i]
                i += 1
        print(ans)
    except:
        break

Submission status: Accepted

Solution code:
import sys

for line in sys.stdin:
    line = line.strip()
    i = 0
    ans = ""
    while i < len(line):
        if line[i] == "@":
            m = int(line[i+1])
            c = line[i+2]
            i += 3
            ans += m*c
        else:
            ans += line[i]
            i += 1
    print(ans)

Submission status: Accepted

Solution code:
while 1:
    try:s=input()
    except:break
    i,a,n=0,'',1
    for i in s:
        if n==0:n=int(i)
        elif i=='@': n=0
        else:
            a+=i*n
            n=1
    print(a)

Submission status: Accepted

Solution code:
def aux(s):
  return(s[1]*int(s[0]) + s[2:])

while True:
  try:
    s = input().strip()
    v = s.split('@')
    t = v[0]
    for i in (map(lambda x:aux(x), v[1:])):
      t += i
    print(t)

  except EOFError:
      break

Submission status: Accepted

Solution code:
while True:
    try:
        S = input()
    except EOFError:
        break
    ans = ''
    i = 0
    while i < len(S):
        if S [i] == '@':
            ans += S [i + 2] * int(S [i + 1])
            i += 3
        else:
            ans += S [i]
            i += 1
    print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

import sys
import os
import math

for s in sys.stdin:
    s = s.strip()
    answer = []
    i = 0
    while i < len(s):
        if s[i] == '@':
            num = int(s[i+1])
            c = s[i+2]
            answer.append(c * num)
            i += 3

        else:
            answer.append(s[i])
            i += 1

    print(''.join(answer))

Submission status: Accepted

Solution code:
while 1:
    res = ""
    check = []
    try:
        s = input()
        for i in range(len(s)):
            if i in check:
                continue
            elif s[i] == "@":
                res = res + s[i+2] * int(s[i+1])
                check.append(i+1)
                check.append(i+2)
            else:
                res = res + s[i]
        print(res)
    except EOFError:
        break

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0077
"""
import sys




def expand(data):
    result = []
    skip_count = 0
    for i in range(len(data)):
        if skip_count:
            skip_count -= 1
        else:
            if data[i] == '@':
                skip_count = 2
                num = int(data[i+1])
                c = data[i+2]
                result.append(c*num)
            else:
                result.append(data[i])
    return (''.join(result))



def main(args):
    for line in sys.stdin:
        result = expand(line.strip())
        print(result)


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

Solution code:
while True:
    try:
        string = input()
    except:
        break
    ans = ""
    i = 0
    while i < len(string):
        if string[i] == "@":
            ans += int(string[i+1])*string[i+2]
            i += 3
        else:
            ans += string[i]
            i += 1
    print(ans)

Submission status: Accepted

Solution code:
# Aizu Problem 0077: Run Length
#
import sys, math, os

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")


def run_length(string):
    out = ""
    k = 0
    while k < len(string):
        char = string[k]
        if char != '@':
            out += char
            k += 1
        else:
            cnt = int(string[k+1])
            char = string[k+2]
            out += char * cnt
            k += 3
    return out


for line in sys.stdin:
    print(run_length(line.strip()))

Submission status: Accepted

Solution code:
def get_input():
    while True:
        try:
            yield ''.join(input())
        except EOFError:
            break

N = list(get_input())
for l in range(len(N)):
    S = N[l]
    skip = 0
    for i in range(len(S)):
        if skip > 0:
            skip -= 1
        elif S[i] == "@":
            n = int(S[i+1])
            for j in range(n):
                print(S[i+2],end="")
            skip = 2
        else:
            print(S[i],end="")
    print("")

Submission status: Accepted

Solution code:
while True:
    try:
        s_inp = input()
        s_out = ""
        flag = 0
        for c in s_inp:
            if flag == 1:
                n = int(c)
                flag = 2
            elif flag == 2:
                for i in range(n):
                    s_out = s_out + c
                flag = 0
            elif c == "@":
                flag = 1
            else:
                s_out = s_out + c
        print(s_out)
    except:
        break

Submission status: Accepted

Solution code:
import sys
for e in sys.stdin:
 a='';b=n=0
 for c in e[:-1]:
  if'@'==c:b=1
  elif b&1:n=int(c);b=2
  elif b&2:a+=c*n;b=0
  else:a+=c
 print(a)

Submission status: Accepted

Solution code:
import sys
for e in sys.stdin:
 a,n='',1
 for c in e[:-1]:
  if'@'==c:n=0
  elif n<1:n=int(c)
  else:a+=c*n;n=1
 print(a)

Submission status: Accepted

Solution code:
def restore(s):
  ret = ""
  ind = 0
  end = len(s)
  while ind < end:
    if s[ind] == "@":
      ret += s[ind + 2] * int(s[ind + 1])
      ind += 3
    else:
      ret += s[ind]
      ind += 1
  return ret

while True:
  try:
    print(restore(input()))

  except EOFError:
    break

Submission status: Accepted

Solution code:
import sys
for s in sys.stdin:
    s=s[:-1]
    while 1:
        idx=s.find("@")
        if idx==-1:break
        s=s.replace(s[idx:idx+3],
                    "".join([s[idx+2] for _ in range(int(s[idx+1]))]))
    print(s)

Submission status: Accepted

Solution code:
# AOJ 0077 Run Length
# Python3 2018.6.15 bal4u

while True:
	try: s = list(input())
	except EOFError: break
		
	ans = []
	i = 0
	while i < len(s):
		if s[i] == '@':
			for j in range(int(s[i+1])): ans += s[i+2]
			i += 2
		else: ans += s[i]
		i += 1
	print(*ans, sep='')

Submission status: Accepted

Solution code:
import sys
while True:
  try:
    ans=[]
    hoge=raw_input()
    hoge+="  "
    for i in range(len(hoge)-2):
      if hoge[i] == "@":
        tt = hoge[i+2]*int(hoge[i+1])
        ans.append(tt)
      else:
        if hoge[i-1] == "@" or hoge[i-2] == "@":
          continue
        else:
          ans.append(hoge[i])
    else:
      for i in range(len(ans)):
        sys.stdout.write(ans[i])
      else: print ""
  except EOFError: break

Submission status: Accepted

Solution code:
while True:
    try:
        array = map(str,raw_input())
        display = []
        for i in range(len(array)):
            if array[i] != '@':
                display.append(array[i])
            elif array[i] == '@':
                insert = int(array[i+1])*array[i+2]
                display.append(insert)
                array[i+1] ,array[i+2]= '',''
            
        for i in range(len(display)-1):
            display[i+1] = display[i]+ display[i+1]

        print display[-1]
    except EOFError:
        break

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# coding: utf-8

import sys
import re


def get_answer(s):
    encodeds = re.findall(r"@\d.", s)
    for encoded in encodeds:
        n = int(encoded[1])
        c = encoded[2]
        s = s.replace(encoded, c * n)
    return s


def main():
    params = [line.rstrip() for line in sys.stdin.readlines()]
    for param in params:
        print get_answer(param)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
for line in sys.stdin.readlines():
    while True:
        i=line.find("@")
        if i==-1:
            break
        line=line.replace(line[i:i+3],line[i+2]*int(line[i+1]))
    print line,

Submission status: Accepted

Solution code:
text  = []                                                                                                
ptext = []

while True:
    try:
        text = list(map(str,raw_input()))
        f = 0
        ptext = []

        for i in range(len(text)):
            if text[i] == '@':

                for k in range(int(text[i+1])-1):
                    ptext.append(text[i+2])

                f = 1

            else:
                if f == 0:
                    ptext.append(text[i])
                else:
                    f = 0

        print "".join(map(str,ptext))

    except EOFError:
        break
text  = []                                                                                                
ptext = []

while True:
    try:
        text = list(map(str,raw_input()))
        f = 0
        ptext = []

        for i in range(len(text)):
            if text[i] == '@':

                for k in range(int(text[i+1])-1):
                    ptext.append(text[i+2])

                f = 1

            else:
                if f == 0:
                    ptext.append(text[i])
                else:
                    f = 0

        print "".join(map(str,ptext))

    except EOFError:
        break

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import (division, absolute_import, print_function,
                        unicode_literals)
from sys import stdin

li = []
for line in stdin:
    compress = False
    num = 1
    for c in line:
        if c == '@':
            compress = True
        elif compress:
            compress = False
            num = int(c)
        else:
            li.append(c * num)
            num = 1
print(''.join(li), end='')

Submission status: Accepted

Solution code:
import re,sys

for s in sys.stdin:
	l = re.split('(@.{2})',s)
	for s in l:
		if '@' in s:
			s = s[2] * int(s[1])
		sys.stdout.write(s)

Submission status: Accepted

Solution code:
while True:
    try:
        inp = raw_input()
        i, msg = 0, ""
        while i < len(inp):
            if inp[i] == "@":
                msg += inp[i+2]*int(inp[i+1])
                i += 3
            else:
                msg += inp[i]
                i += 1
        print msg
    except:
        break

Submission status: Accepted

Solution code:
import sys
for s in sys.stdin:
    n=s.count("@")
    m=0
    x=""
    for c in s[:-1]:
        if m==0:
            if c=="@":m=1
            else:x+=c
        elif m==1:
            a="0123456789".index(c)
            m=2
        elif m==2:
            x+=c*a
            m=0
    print x

Submission status: Accepted

Solution code:
import sys
for s in sys.stdin:
    while 1:
        p=s.find("@")
        if p==-1:break
        s=s.replace(s[p:p+3],s[p+2]*int(s[p+1]))
    print s[:-1]

Submission status: Accepted

Solution code:
import sys
for s in sys.stdin:
    while 1:
        p = s.find("@")
        if p==-1: break
        s = s.replace(s[p:p+3], s[p+2] * int(s[p+1]))
    print s[:-1]

Submission status: Accepted

Solution code:
while True:
	try:
		char = raw_input()
		ans = ""
		while "@" in char:
			ans += char[0:char.index("@")]
			char = char[char.index("@"):]
			char = char[2] * int(char[1]) + char[3:]
		ans += char
		print ans
	except:
		break

Submission status: Accepted

Solution code:
while 1:
    try:
        line = raw_input()
    except EOFError:
        break
    i = 0
    ret = ''
    while i < len(line):
        if line[i] == '@':
            ret += line[i + 2] * int(line[i + 1])
            i += 3
        else:
            ret += line[i]
            i += 1
    print ret

Submission status: Accepted

Solution code:
while True:
    try:
        s = input()
    except EOFError:
        break

    r = ''
    n = 1
    for c in s:
        if n < 0:
            n = int(c)
        elif c == '@':
            n = -1
        else:
            r += c * n
            n = 1
    print(r)

Submission status: Accepted

Solution code:
while True:
    try:
        Tlist = list(input())
    except:
        break
    while '@' in Tlist:
        at = Tlist.index('@')
        t = Tlist[at+2]
        x = int(Tlist[at+1])
        del(Tlist[at:at+3])
        Tlist.insert(at,t*x)
    print(''.join(Tlist))

Submission status: Accepted

Solution code:

import sys

for x in sys.stdin:
    for i in range(1000):
        if x[i] == "@":
            x = x[:i] + x[i+2]*int(x[i+1]) + x[i+3:]

        if i == len(x) - 1:
            break
    print(x,end="")

Submission status: Accepted

Solution code:
while True:
    try:
        s = list(input())
        while '@' in s:
            num = s.index('@')
            s[num+1] = s[num+2] * (int(s[num+1])-1)
            s.pop(num)

    except EOFError:
        break

    print(''.join(s))

Submission status: Accepted

Solution code:
while True :
    try :
        s = list(input())
    except EOFError :
        break
    
    i = 0
    while i < len(s) :
        if s[i] == "@" :
            for j in range(int(s[i+1])) :
                print(s[i+2], end="")
            i += 3
        else :
            print(s[i], end="")
            i += 1
    print()

Submission status: Accepted

Solution code:
import sys
readlines = sys.stdin.readlines
write = sys.stdout.write
def solve():
    for line in readlines():
        s = line.strip()
        ans = []
        L = len(s)
        i = 0
        while i < L:
            if s[i] == "@":
                k = int(s[i+1])
                i += 2
            else:
                k = 1
            c = s[i]
            ans.append(c*k)
            i += 1
        write("".join(ans))
        write("\n")
solve()

Submission status: Accepted

Solution code:
try:
    while True:
        n = 0
        str3 = []
        str1 = input()
        str2 = [a for a in str1]
        num = len(str2)
        for num1 in range(0,num):
            if str2[num1] == "@":
                for num2 in range(int(str2[num1 + 1])):
                    print(str2[num1 + 2],end="")
                n = 2
                continue
            else:
                if n > 0:
                    n -= 1
                    continue
                else:
                    print(str2[num1],end="")
                    continue
        print()
except EOFError as e:
    n = 0

Submission status: Accepted

Solution code:
while True:
    try:
        str = input()
        ans = ''
        # flag
        n = 1
        
        for c in str:
            if '@' == c:
                n = 0
            elif n < 1:
                n = int(c)
            else:
                ans += c * n
                n = 1
        print(ans)
    except:
        break

Submission status: Accepted

Solution code:
while True:
    try:
        a = list(input())
    except:
        break
    ans = ""
    for i in range(len(a)-a.count("@")*2):
        if a[i] == "@":
            ans += a[i+2]*int(a[i+1])
            del a[i+1:i+3]
        else:
            ans += a[i]
    print(ans)

Submission status: Accepted

Solution code:
import sys
  
r = []
for string in sys.stdin:
    i = 0
    s = ""
    sin = string.strip()
    while i < len(sin):
        if sin[i] == '@':
            s += sin[i+2] * int(sin[i+1])
            i = i+3
        else:
            s += sin[i]
            i += 1
    r.append(s)

print(*r, sep='\n')

Submission status: Accepted

Solution code:
while 1:
    try:
        s = input()
        t = ''
        i = 0
        while i < len(s):
            if s[i] == '@':
                t += s[i + 2] * int(s[i + 1])
                i += 3
            else:
                t += s[i]
                i += 1
        print(t)
    except:
        break

Submission status: Accepted

Solution code:
if __name__ == '__main__':

    ans = ""
    while True:
        try:
            tmp = ""
            ans = ""
            line = input()
            for x in line:
                if x == "@":
                    tmp += "@"
                else:
                    if len(tmp) == 0:
                        ans += x
                    else:
                        tmp += x
                        if len(tmp) == 3:
                            ans += tmp[2]*int(tmp[1])
                            tmp = ""
            print(ans)
        except EOFError:
            break

Submission status: Accepted

Solution code:
###
### atcorder test program
###

import sys

### math class
class math:
    ### pi
    pi = 3.14159265358979323846264338

    ### GCD
    def gcd(self, a, b):
        if b == 0:
            return a
        return self.gcd(b, a%b)

    ### LCM
    def lcm(self, a, b):
        return (a*b)//self.gcd(a,b)

    ### Prime number search
    def Pnum(self, a):
        if a == 1: return False
        for i in range(2,int(a**0.5)+1):
            if a % i == 0:
                return False
        return True

    ### Circle area
    def caria(self, r):
        return r*r*self.pi

math = math()

### input sample
#i = input()
#A, B, C = [x for x in input().split()]
#inlist = [int(w) for w in input().split()]
#R = float(input())
#A = [int(x) for x in input().split()]
#for line in sys.stdin.readlines():
#    x, y = [int(temp) for temp in line.split()]

### output sample
#print("{0} {1} {2:.5f}".format(A//B, A%B, A/B))
#print("{0:.6f} {1:.6f}".format(R*R*math.pi,R*2*math.pi))
#print(" {}".format(i), end="")

#A, B, C = [int(x) for x in input().split()]

def get_input():
  N = []
  while True:
    try:
      N.append(input())
      #N.append(int(input()))
    except EOFError:
      break
  return N
 
N = get_input()

for S in N:
    i = 0
    while True:
        if i >= len(S):
            break
        if (S[i]=='@'):
            for j in range(int(S[i+1])):
                print(S[i+2], end='')
            i += 3
        else:
            print(S[i], end='')
            i += 1
        
    print()

Submission status: Accepted

Solution code:
while 1:
    try:
        count = 0
        answer = ""
        N = list(input())
        for i in N:
            if i == "@":
                answer += int(N[count + 1]) * N[count + 2]
                del N[count], N[count + 1]
            else:
                answer += N[count]
            count += 1
        print(answer)
    except:
        break

Submission status: Accepted

Solution code:
import sys
for line in sys.stdin:
	s = line
	ans = ''
	flag = False
	reg = 1
	for i in range(0, len(s)-1):
		if flag:
			reg = int(s[i])
			flag = False
		else:
			if s[i] == '@':
				flag = True
			else:
				for j in range(0, reg):
					ans = ans + s[i]
					reg = 1
	print ans

Submission status: Accepted

Solution code:
while 1:
    try:
        s=list(input())
        ans=""
        while len(s)>0:
            i=s.pop(0)
            if i=="@":
                c=s.pop(0)
                l=s.pop(0)
                ans+=l*int(c)
            else:ans+=i
        print(ans)
    except:break

Submission status: Accepted

Solution code:
while(1):
    try:
        s = list(input())
        skip = 0
        o = []
        for i in range(len(s)):
            if skip != 0:
                skip -= 1
                continue
            if s[i] != "@":
                o.append(s[i])
            else:
                skip = 2
                for j in range(int(s[i+1])):
                    o.append(s[i+2])
        print(*o,sep="")

    except EOFError:
        break

Submission status: Accepted

Solution code:
while 1:
    try:
        word = input()
    except EOFError:
        break

    newword = []
    word = list(word)
    while word != []:
        w = word.pop(0)
        if w == "@":
            count = int(word.pop(0))
            s = word.pop(0)
            for _ in range(count):
                newword.append(s)
        else:
            newword.append(w)

    print(''.join(w for w in newword))

Submission status: Accepted

Solution code:
while True:
    try: n = input().split('@')
    except: break

    S, ans = n[1:], n[0]
    for s in S:
        ans += int(s[0]) * s[1]
        ans += s[2:]
    print(ans)

Submission status: Runtime Error

Solution code:
while True:
    array = map(str,raw_input())
    display = []
    for i in range(len(array)):
        if array[i] != '@':
            display.append(array[i])
        elif array[i] == '@':
            insert = int(array[i+1])*array[i+2]
            display.append(insert)
            array[i+1] ,array[i+2]= '',''
        
    for i in range(len(display)-1):
        display[i+1] = display[i]+ display[i+1]

    print display[-1]

Submission status: Runtime Error

Solution code:
text  = []
ptext = []

while True:
    try:


        text = list(map(str,raw_input()))
#        print text
        f = 0
        ptext = []

        for i in range(len(text)):
            if text[i] == '@':
#                print text[i]

                for k in range(int(text[i+1])-1):
                    ptext.append(text[i+2])

                f = 1

            else:
                if f == 0:
                    ptext.append(text[i])
                else:
                    f = 0

Submission status: Runtime Error

Solution code:
while True:
    inp = raw_input()
    msg = ""
    for i in range(len(inp)):
        if inp[i] == "@": msg += inp[i+2]*int(inp[i+1])
        else: msg += inp[i]
    print msg

Submission status: Runtime Error

Solution code:
import sys
for inp sys.stdin:
    msg = ""
    for i in range(len(inp)):
        if inp[i] == "@": msg += inp[i+2]*int(inp[i+1])
        else: msg += inp[i]
    print msg

Submission status: Runtime Error

Solution code:
import sys
for s in sys.stdin:
    while 1:
        p　=　s.find("@")
        if p==-1:　break
        s　=　s.replace(s[p:p+3],　s[p+2]　*　int(s[p+1]))
    print s[:-1]

Submission status: WA: Presentation Error

Solution code:

import sys
for line in sys.stdin:
    appendStrs = []
    for i in range(0, len(line) ) :
        if line[i] == "@" :
            appendStrs.append((line[i:i+3], "".join([ line[i+2] for _ in range(0, int(line[i+1]) )]))) ;
    for a in appendStrs :
        line = line.replace(*a, 1)
    print(line)