#include<bits/stdc++.h>
using namespace std;
int main(){
string s;
getline(cin,s);
int bi=0;
for(int i=0;i<s.size();i++){
if(s[i]==' '){
for(int j=i-1;j>=bi;j--)
cout<<s[j];
cout<<endl;
bi=i+1;
}
if(i==s.size()-1&&s[i]!=' ')
for(int j=i;j>=bi;j--)
cout<<s[j];
}
return 0;
}