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