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