#include <iostream>
#include <string>
#include <sstream>
#include <algorithm>  // really really useful
using namespace std;

string reverse(string w){
   // w = "ameoba"
   string r;  // r is empty initially
   for (int i = 0; i < w.length(); ++i)
      r += w[w.length() - i - 1];
   return r;
}

void process(string line){
     // "I love you."
     //  => "I", "love", "you."
     istringstream src(line);
     string w;
     if (src >> w) {            
        reverse(w.begin(), w.end());
        //      ^^^^^^^^
        //      iterator (pointer-like object)
        //
        //                         v---- w.end() is one-pass-the-end
        //  w : [ l | o | v  | e ]
        //        ^                
        //       w.begin() "points" to the first item
        //   cout << *(w.begin())
        cout << w;
        }
     while (src >> w){
        reverse(w.begin(), w.end());
        cout << ' ' << w;
        }
     cout << endl;
}

int main(){
  string line;
  while (getline(cin, line)){
        // line contains "I love you."
        process(line);
  }
    
}
