program B;
var i,j,a1,a2,n,t:integer;
m1,m2:array [1..2000] of integer;
inp,out:text; c:char; s,s1,s2,s3:string;
begin
   s1:='';  j:=1; t:=0; i:=1;              writeln;
assign(inp,'input.txt'); reset(inp);
assign(out,'output.txt'); rewrite(out);
while not eoln(inp) do begin
s:='';
read(inp,c);  s:=c;
t:=t+1;
val(s,m1[i],n);
i:=i+1;
end;
if m1[1]=m1[2] then m2[i]:=1;
for i:=2 to t do begin
if m1[i]=m1[i-1] then m2[i]:=m2[i-1]+1;
end;
for i:=1 to t do
m2[i]:=m2[i]+1;
i:=1;  s:='';
for i:=1 to t do begin
if m2[i+1]<=m2[i] then str(m2[i],s1);
if m2[i+1]<=m2[i] then str(m1[i],s2);
if m2[i+1]<=m2[i] then s:=s+s1+s2;
end;
writeln(s);
write(out,s);
close(inp);
close(out);
end.