#include <iostream>
#include <cstdio>
using namespace std;
int main(void) {
string str;
getline(cin,str);
int len = str.size(),r = 0,h = 0;//r为行,h为列
char ans[90][90]; //ans[0]~ans[r]存放单词
for(int i = 0;i<len;i++){
if(str[i] != ' '){ //不是空格放进去
ans[r][h++] = str[i];
}else {
ans[r][h] = '\0'; //末尾添加结束符 '\0'
r++;
h = 0;
}
}
for(int i = r;i>=0;i--){
cout << ans[i];
if(i>0) cout << " ";
}
cout << endl;
}