#include<bits/stdc++.h>
using namespace std;
bool hash[1050];
int num[1050];
int res[1050];
void input(int x)
{
for(int i=0; i<x; i++)
scanf("%d",&num[i]);
}
void output(int x)
{
printf("%d\n",x);
for(int i=0; i<x; i++)
{
printf("%d",res[i]);
if(i!=x-1)
printf(" ");
}
}
int dele(int n)
{
memset(hash,false,sizeof(hash));
int j=1;
res[0]=num[0];
hash[num[0]]=true;
for(int i=0; i<n; i++)
if(hash[num[i]]==true)
continue;
else
{
hash[num[i]]=true;
res[j]=num[i];
j++;
}
return j;
}
int main()
{
int n;
scanf("%d",&n);
input(n);
output(dele(n));
return 0;
}