#include<stdio.h>
#include<string.h>
int main(){
    int n;
    char sentence[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]",sentence);
    char *word=strtok(sentence," ");
    while(word !=NULL)
    {
        strcpy(words[++top],word,100);
        words[top][100]='\0';
        words=strtok(NULL," ");
    }
    for(int i=top;i>=0;i--)
    {
        printf("%s" ,words[i]);
        if(i>0)
            printf(" ")
    }
    return 0;
}