var
f,fR:Text;
i,N,b,e:integer;
ch:char;
s,ts:string;
begin
Assign(f,'text.txt');
reset(f);
Assign(fR,'text2.txt');
rewrite(fR);
readln(f,s);
b:=0;
e:=0;
N:=length(s);
for i:=1 to N do
begin
if (s[i] in ['0'..'9']) and (b=0) then b:=i;
if (s[n-i+1] in ['0'..'9']) and (e=0) then e:=n-i+1;
end;
ts:=s;
if b<>0 then
begin
while (b<e) do
begin
ch:=ts[b];
ts[b]:=ts[e];
ts[e]:=ch;
i:=b+1;
while not(ts[i] in ['0'..'9']) do inc(i);
b:=i;
i:=e-1;
while not(ts[i] in ['0'..'9']) do dec(i);
e:=i;
end;
end;
writeln(fr,ts);
close(f);
close(fr);
end.