#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
string s;
string t;
while (cin >> s) {
reverse(s.begin(), s.end());
t += s + ' ';
}
if (t.back() == ' ') t.pop_back();
reverse(t.begin(), t.end());
cout << t << endl;
return 0;
}