#include<stdio.h>
#include<string.h>
void reserve(char arr[110],int left,int right)
{
while(left<right)
{
int temp=arr[left];
arr[left]=arr[right];
arr[right]=temp;
left++;
right--;
}
}
int main()
{ char arr[110]={0};
gets(arr);
int i,j;
int begin=0,end=0;
int len=strlen(arr);
while(end<=len)
{
if(arr[end]!=' '&&arr[end]!='\0')
{
end++;
}
else
{
reserve(arr,begin,end-1);
for(j=begin;j<end;j++)
{
printf("%c",arr[j]);
}
printf("\n");
begin=++end;
}
}
return 0;
}