#include <algorithm>
#include <iostream>
#include <vector>
#include <sstream>
using namespace std;
string reverseSentence(const string& sentence) {
// 使用字符串流分割句子为单词
vector<string> words;
stringstream ss(sentence);
string word;
while (ss >> word) {
words.push_back(word);
}
// 逆序遍历拼接为句子
string reversedSentence;
for (size_t i = 0; i < words.size(); ++i) {
if (i > 0) {
reversedSentence += " ";
}
reversedSentence += words[words.size() - 1 - i];
}
return reversedSentence;
}
int main() {
string sentence;
// 输入句子
getline(cin, sentence);
// 逆序并输出结果
string result = reverseSentence(sentence);
cout << result << endl;
return 0;
}