#include<cstdio>
#define N 100;
char word[N];
int main()
{
int len=0;
while(gets(word)!=EOF)
{
len=strlen(word)-1;
for(char* ptr=word+len; ptr>=word; --ptr)
{
if( *ptr==' ') printf("%s ",ptr+1),*ptr='\0';;
else if(word==ptr) printf("%s",ptr);
}
}
return 0;
}