#include<stdio.h>
#include<string.h>
int main()
{
    int n; 
    char sen[101];
    char words[10][101];
    int top==-1;
    if(scanf("%d",&n)!=1)
    {
        printf("Invalid input");
        return 0;
    }
    if(n<0||n>10){
        printf("Invalid input");
        return 0;
    }
    scanf(" %[^\n]",sen);
    char *word=strtok(sen," ");
    while(word!=NULL)
    {
        strncpy(words[++top],word,100);
        words[top][100]='\0';
        word=strtok(NULL," ");
        
    }
    for(int i=top;i>-0;i--){
        printf("%s",words[i]);
        if(i>0)printf(" ");
    }
    return 0;
}