// editor3
#include<stdio.h>
#include<stdlib.h>
typedef struct list
{
    int data;
    struct list *next,*prev;
}node;

node *head=NULL;

void create(int n)
{
    node *nd=(node*)malloc(sizeof(node));
    nd->data=n;
    nd->next=nd->prev=NULL;
    if(head==NULL)
    {
        head=nd;
    }
    else
    {
        nd->prev=nd;
        nd->next=head;
        head=nd;
    }
}

void print()
{
    node *temp=head;
    while(temp!=NULL)
    {
         node *temp2=NULL;
         if(temp->next==NULL)
         node *temp2=temp;
         else
         node *temp2=temp->next;
         while(temp2!=NULL)
         {
             if(temp->data==temp2->data)
             {
                 temp2->prev->next=temp2->next;
                 if(temp2->next!=NULL)
                 temp2->next->prev=temp2->prev;
             }
             temp2=temp2->next;
         }
         temp=temp->next;
    }
    node *ptr=head;
    while(ptr!=NULL)
    {
        printf("%d ",ptr->data);
        ptr=ptr->next;
    }
}

int main()
{
    int n;
    scanf("%d",&n);
    for(int i=0;i<n;i++)
    {
        int data;
        scanf("%d",&data);
        create(data);
    }
    print();
}