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