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