// editor5
#include<stdio.h>
#include<stdlib.h>

typedef struct Node{
    char data;
    struct Node *next;
    struct Node *prev;
}Node;

Node *head=NULL, *tail=NULL;

Node *createNode(int data){
    Node *newNode=(Node*)malloc(sizeof(Node));
    newNode->data=data;
    newNode->next=NULL;
    newNode->prev=NULL;
}

void addNode(int data){
    Node *newNode=createNode(data);
    if(head==NULL){
        head=tail=newNode;
    }
    else{
        Node *temp=head;
        while(temp!=NULL){
            if(temp->data==newNode(data))return;
        }
        tail->next=newNode;
        tail=newNode;
    }
}

void displayNode(){
    Node *temp=head;
    while(temp!=NULL){
        printf("%c ", temp->data);
    }
}

int main(){
    int size;
    char data;
    scanf("%d", &size);
    if(size<0){
        printf("Invalid input");
        return 0;
    }
    for(int i=0;i<size;i++){
        scanf("%c", &data);
        addNode(data);
    }
}