program yoda;
var r,u,o,m,i,n,j,b,d,a:integer;
    s,l,w,e:string;
    k:char;
Begin
readln(s);
n:=length(s);
for i:=n downto 1 do begin
j:=n-i;
j:=j+1;
l[j]:=s[i];
end;
for i:=1 to n do begin
if (l[i]<>' ') and ((i=1) or (l[i-1]=' ')) then begin
d:=i-1;
w:='';
e:='';
for j:=i to n do
if l[j]=' ' then begin a:=j;break;end;
for j:=1 to a do
w[j]:=l[d+j];
o:=length(w);
u:=o-j;
for j:=o downto 1 do
e[j]:=w[u+1];
for r:=i to d+o do begin
l[r]:=e[r-d];end;
end;
end;
for i:=1 to n do write(l[i]);
writeln(' ');
End.






































