#include <stdio.h>

int main()
{
    char str[500][30] = {0};
    int i = 0;
    while (~scanf("%s", str[i]))
    {
        i++;
    }
    for (i-=1; i>=0; i--)
    {
        printf("%s ", str[i]);
    }
    return 0;
}