#include<stdio.h>
#include<stdlib.h>
typedef struct node{
    char data;
    struct node *prev;
    struct node *next;
} s1;

s1 *head=NULL,*tail=NULL;

void create(int num){
    s1 *new=(s1*)malloc((sizeof(s1)));
    new->data=num;
    new->prev=NULL;
    new->next=NULL;
    if(head==NULL){
        head=new;
        tail=new;
    }else{
        tail->next=new;
        new->prev=tail;
        tail=new;
    }
}

void display(){
    s1 *i;
    for(i=head;i!=NULL;i=i->next){
        printf("%d ",i->data);
    }
}

int main(){
    int size;
    char c;
    scanf("%d",&size);
    for(int i=1;i<=size;i++){
        scanf("%c ",c);
        create(c);
    }
    display();
    return 0;
}