#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main()
{
string str ;
char buf[104];
fgets(buf,104,stdin);
str = buf;
int beg = 0,end = 0;
for(int i = 0 ;i<str.length(); i++){
if(str[i]==' '||str[i]=='\n'){
end = i;
reverse(str.begin()+beg,str.begin()+end);
string temp = str.substr(beg,end-beg);
cout<<temp<<endl;
beg = i+1;
}
}
return 0;
}