#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
using namespace std;
int main() {
string s;
bool first;
while(getline(cin, s)){
istringstream is(s);
first = true;
while(is>>s){
reverse(s.begin(), s.end());
if(!first) cout<<" ";
cout<<s;
first = false;
}
cout<<endl;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3N0cmVhbT4KI2luY2x1ZGUgPGFsZ29yaXRobT4KI2luY2x1ZGUgPHN0cmluZz4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluKCkgewogICAgc3RyaW5nIHM7CiAgICBib29sIGZpcnN0OwogICAgd2hpbGUoZ2V0bGluZShjaW4sIHMpKXsKCWlzdHJpbmdzdHJlYW0gaXMocyk7CglmaXJzdCA9IHRydWU7Cgl3aGlsZShpcz4+cyl7CiAgICAgICAgCXJldmVyc2Uocy5iZWdpbigpLCBzLmVuZCgpKTsKCQlpZighZmlyc3QpIGNvdXQ8PCIgIjsKCSAgICAgICAgY291dDw8czsKCQlmaXJzdCA9IGZhbHNlOwoJfQoJY291dDw8ZW5kbDsKICAgIH0KCXJldHVybiAwOwp9