program yoda;
var
s,s1:string;
i,j:integer;
begin
readln(s);
i:=length(s);
repeat
s1:='';
while (s[i]<>' ') and (i>0) do begin
s1:=s1+s[i];
i:=i-1;
end;
i:=i-1;
for j:=length(s1) downto 1 do
write(s1[j]);
if i>0 then write(' ');
until i=-1;
writeln;
end.