#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
    string s,word;
    getline(cin,s);
    for(int i=0;i<s.length();i++)
    {
        if(s[i]==' ')
        {
            reverse(word.begin(),word().end());
            cout <<word<<' ';
            word=" ";
        }
        else{
            word+=s[i];
        }
    }
    if(!word.empty())
    {
        reverse(word.begin(),word.end());
        cout<<word;
    }
    return 0;
}