#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#define max 100
char* stack[max];
int top=-1;
void push(char* word)
{
    if(top<max-1)
    {
        stack[++top]=word;
    }
}
char* pop()
{
    if(top>=0)
    {
        return stack[top--];
    }
    return NULL;
}
void reverse(char* sentence)
{
    char* word[max];
    int wordcount=0;
    char* token=strtok(sentence," ");
    while(token!=NULL)
    {
        push(tokrn);
        token =strtok(NULL," ");
        wordcount++;
    }
    for(int i=0;i<wordcount;i++)
    {
        char* word=pop();
        if(i==wordcount-1)
        {
            printf("%s\n",word);
        }
        else
        {
            printf("%s ",word);
        }
    }
}
int main()
{
    int n;
    char sentence[max];
    scanf("%d\n",&n);
    if(n<0)
    {
        printf("Invalid input");
        return 0;
    }
    fgets(sentence,sizeof(sentence),stdin);
    sentence[strcspn(sentence,"\n")]=0;
    reverse(sentence);
}