#include<stdio.h>
#include<string.h>
#include<string.h>
int main()
{
int i, j, a;
i = 0;
j = 0;
a = 0;
char str[1000];
gets (str);
while(str[i] != '\0')
{
if( str[i] != ' ')
{
a++;
if(str[i + 1] == ' ' || str[i + 1] == '\0')
{
j = i;
for(j = i; j >= i - a; j--)
{
printf("%c", str[j]);
}
}
}
else if(str[i] == ' ')
{
a = 0;
printf("");
}
i++;
}
printf("\n");
}