#include <stdio.h>
#include <string.h>
#define MAX_SIZE 100
int main()
{
char str[1000], reverse[1000];
int len, i, index=0, wordStart, wordEnd;
fgets(str,1000,stdin);
len = strlen(str);
wordStart = len - 1;
wordEnd = len - 1;
while(wordStart > 0)
{
if(str[wordStart] == ' ')
{
i = wordStart + 1;
while(i <= wordEnd)
{
reverse[index] = str[i];
i++;
index++;
}
reverse[index++] = ' ';
wordEnd = wordStart - 1;
}
wordStart--;
}
for(i=0; i<=wordEnd; i++)
{
reverse[index] = str[i];
index++;
}
reverse[index] = '\0';
//printf("%s", reverse);
for (i=0;i<strlen(reverse);i++){
if (reverse[i]=='\n')
;
else
printf("%c",reverse[i]);
}
return 0;
}