#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;
}
