#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <cctype>
using namespace std;

int main() {
    string sentence, word;
    vector<string> words;
    getline(cin, sentence);
    for(auto &ch:sentence)
        if(!isalnum(ch))
            ch = ' ';
    stringstream ss;
    ss << sentence;
    while(ss >> word)
        words.push_back(word);
    for(auto it=words.rbegin();it != words.rend();it++)
        cout << *it << " ";
}
// 64 位输出请用 printf("%lld")