// editor5
#include<stdio.h>
#include<string.h>
#define MAX 100
void reverseSentence(char *sentence){
    char stack[MAX][MAX];
    int top = -1, i = 0, j = 0;
    char word[MAX];
    while(sentence[i]){
        if(sentence[i] == ' ') {
            word[j] = '\0';
            strcpy(stack[++top], word);
            j = 0;
        }else {
            word[j++]  =sentence[i];
        }
        i++;
        }
        word[j] = '\0';
        strcpy(stack[++top], word);
        while(top >= 0){
    printf("%s", stack[top--]);
    if(top >= 0)
    printf(" ");
}
printf("\n");
}
int main(){
    int n;
    char sentence[MAX];
    scanf("%d\n", &n);
    if(n < 0) {
        printf("Invalid input\n");
    }else{
        fgets(sentemnce, sizeof(sentence), stdin);
        sentence[strcspn(sentence, "\n")] = 0;
        reverseSentence(sentence);
    }
    return 0;
}