var
a, b, c: string;
d: array of char := (' ', ',', '.', '-', '!', '?');
e: array of char;
begin
readln(a);
foreach b in a.Split(d, System.StringSplitOptions.RemoveEmptyEntries) do
begin
e := b.ToCharArray();
System.Array.Reverse(e);
write(String.Create(e), ' ');
end;
end.