#include<iostream>
#include<fstream>
#include<string>
using namespace std;
int main()
{
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
int i, j, k, start, end;
char c;
string str;
while(!cin.eof()){
getline(cin, str);
for(start=0, i=0 ; i<str.size() ; i++){
while(str[i]!=' ' && i!=str.size()){i++;}
end = i-1;
while(start<=end){
cout << str[end];
end--;
}
start = i+1;
if(start!=str.size()) cout << " ";
}
cout << endl;
}
return 0;
}
I2luY2x1ZGU8aW9zdHJlYW0+CiNpbmNsdWRlPGZzdHJlYW0+CiNpbmNsdWRlPHN0cmluZz4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKaW50IG1haW4oKQp7CiAgICAjaWZuZGVmIE9OTElORV9KVURHRQogICAgICAgIGZyZW9wZW4oImlucHV0LnR4dCIsICJyIiwgc3RkaW4pOwogICAgICAgIGZyZW9wZW4oIm91dHB1dC50eHQiLCAidyIsIHN0ZG91dCk7CiAgICAjZW5kaWYKICAgIGludCBpLCBqLCBrLCBzdGFydCwgZW5kOwogICAgY2hhciBjOwogICAgc3RyaW5nIHN0cjsKCiAgICB3aGlsZSghY2luLmVvZigpKXsKICAgICAgICBnZXRsaW5lKGNpbiwgc3RyKTsKICAgICAgICBmb3Ioc3RhcnQ9MCwgaT0wIDsgaTxzdHIuc2l6ZSgpIDsgaSsrKXsKICAgICAgICAgICAgd2hpbGUoc3RyW2ldIT0nICcgJiYgaSE9c3RyLnNpemUoKSl7aSsrO30KICAgICAgICAgICAgZW5kID0gaS0xOwogICAgICAgICAgICB3aGlsZShzdGFydDw9ZW5kKXsKICAgICAgICAgICAgICAgIGNvdXQgPDwgc3RyW2VuZF07CiAgICAgICAgICAgICAgICBlbmQtLTsKICAgICAgICAgICAgfQogICAgICAgICAgICBzdGFydCA9IGkrMTsKICAgICAgICAgICAgaWYoc3RhcnQhPXN0ci5zaXplKCkpIGNvdXQgPDwgIiAiOwogICAgICAgIH0KICAgICAgICBjb3V0IDw8IGVuZGw7CiAgICB9CiAgICByZXR1cm4gMDsKfQo=