Program GIAINEN;
Var s,st: string;
j,i,k,l: byte;
begin
readln(s);
while length(s)<>0 do
begin
for i:=1 to length(s) do
if s[i] in ['A'..'Z'] then st:=st+s[i]
else if s[i] in ['1'..'9'] then break;
for i:=1 to length(s) do
if s[i] in ['2'..'9'] then
begin
val(s[i],k);
l:=i;
break;
end;
for j:=1 to k do write(st);
delete(s,1,l);
st:=''
end;
readln
end.