#include <iostream>
#include <vector>
using namespace std;
vector<string> tmp;
int main(){
string s; getline(cin, s);
string word = "";
for(int i = 0; i < s.size(); i ++ ){
if(s[i] != ' ') word += s[i];
else{
tmp.push_back(word);
word = "";
}
}
if(word != "") tmp.push_back(word);
for(int i = tmp.size() - 1; i >= 0; i -- ) cout << tmp[i] << ' ';
return 0;
}