#include<iostream>
#define MAXSIZE 100
using namespace std;//student. a am I
int main(){
char buf[MAXSIZE][MAXSIZE]={'\0'},c;
int i=0,j=0,k;
while(c=getchar()){
if(c=='\n') break;
if(c==' '){
i++;
j=0;
}
if(c!=' ')
buf[i][j++]=c;
}
for(k=i;k>=0;k--)
if(buf[k][0]!='\0')
cout<<buf[k]<<" ";
cout<<endl;
return 0;
}