#include <cctype> #include <iostream> #include <string> #include <vector> using namespace std; vector<string> v; int main() { string tmp; string s; getline(cin, s); for (auto c : s) { if(isalpha(c)) tmp += c; else { v.push_back(tmp); tmp = ""; } } v.push_back(tmp); for (auto it = v.rbegin(); it != v.rend(); it++) { cout << *it << " "; } }