var
i:integer;
s,ss:string;
begin
readln(s);
for i:=length(s) downto 1 do
begin
if (s[i]=' ') then
begin
write(ss,' ');
ss:='';
end
else
ss:=s[i]+ss;
if i=1 then write(s[i]+ss);
end;
end.
var
i:integer;
s,ss:string;
begin
readln(s);
for i:=length(s) downto 1 do
begin
if (s[i]=' ') then
begin
write(ss,' ');
ss:='';
end
else
ss:=s[i]+ss;
if i=1 then write(s[i]+ss);
end;
end.