#include<iostream>
#include<cstdio>
#include<string>
#include<sstream>
#include<algorithm>
using namespace std;
int main()
{
string M;
getline(cin,M,'\n');
reverse(M.begin(),M.end());
istringstream is(M);
string t;
while(is>>t)
{
reverse(t.begin(),t.end());
cout<<t<<" ";
}
cout<<endl;
return 0;
}