#include<stdio.h>
#include<stdlib.h>

typedef struct node{
    char data;
    struct node *next;
    struct node *prev;
}Node;

 Node *head=NULL,*tail=NULL;
 
void create(char val){
    
     Node *n= (Node*)malloc(sizeof(Node));
     n->data=val;
     n->next=NULL;
     n->prev=NULL;
     
     if(head==NULL){
         head=n;
         tail=n;
         
     }
     else{
         tail->next=n;
         n->prev=tail;
         tail=n;
     }
     
 }
 
void display(){
    
    Node *i;
    for(i=head;i!=NULL;i=i->next){
        printf("%c ",i->data);
        
    }
}

int main(){
    int n;
    char c;
    scanf("%d",&n);
    gets();
    // if(n <= 0){
    //     printf("Invalid input");
    //     return 0;
    // }
    for(int i=0 ;i<n;i++){
        scanf("%c",&c);
        getchar();
         create(c);
        //  printf("%c ",c);
    }
    display();
return 0;
    
}