#include<stdio.h>
#include<string.h>
int main(){
    int n;
    char s[101],stack[50][101];
    int top = -1;
    scanf("%d",&n);
    getchar();
    if(n<=0){
        printf("Invalid input");
        return 0;
    }
    fgets(s, sizeof(s),stdin);
    s[strcspn(s,"\n")='\0';
    char *word =strtok(s," ");
    while(word != NULL){
        strcpy(stack[++top],word);
        word = strtok(NULL," "); 
    }
    if(top +1>n){
        printf("Invalid input");
        return 0;
    }
    for(int i=top;i>=0;i--){
        printf("%s",stack[i]);
        if(i) printf(" ");
    }
    return 0;
}