Title: Run Length Encoding

When a string has consecutive characters, it can be compressed by replacing the characters according to a certain rule. For example, the string "AAAA" can be compressed to "@4A", representing a one-character compression. Create a program that can restore the original string from the compressed string based on this rule. The restored string should not contain the "@" character.

The original string consists of uppercase and lowercase English letters, digits, and symbols, with a length of up to 100 characters and consecutive characters not exceeding 9.

Input:
Multiple strings are provided, with one string per line. The number of strings does not exceed 50.

Output:
For each string, output the restored string for each character on a separate line.

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

Output for the Sample Input:
abCCCCC10000000050
999999999+1=1000000000

# Buggy version:

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)



# Fixed version:
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)

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


# Fixed version:
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()))

# Buggy version:
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))

# Fixed version:
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', '')))

# Buggy version:
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
		
				

# Fixed version:
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

# Buggy version:
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)

# Fixed version:
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)

# Buggy version:
import sys
for e in sys.stdin:
 a='';b=n=0
 for c in e:
  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)


# Fixed version:
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)