#include <cstdio> #include <functional> #include <iostream> #include <queue> #include <string> #include <unordered_map> #include <vector> using namespace std; using LL = long long; int main(){ string s; while (getline(cin, s)){ int n=s.size(); int l=0; for(int i=0; i<n; ++i){ if (s[i]==' '){ reverse(s.begin()+l, s.begin()+i); l=i+1; } } reverse(s.begin()+l, s.end()); reverse(s.begin(), s.end()); cout<<s<<endl;; } return 0; }