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