while 1:
try:
x = input()
d = {"!" : '\n','b':' '}
fac = []
for i in x:
try:
z = int(i)
fac.append(z)
except:
if len(fac) == 0:
if i in d:
print(d[i],end='')
else:
print(i,end='')
else:
if i in d:
print(sum(fac)*d[i],end='')
fac.clear()
else:
print(sum(fac)*i,end='')
fac.clear()
print()
except:
break