#include <stdio.h>
#include <stdlib.h>
#define MAX 1001
int a[MAX]={0};
int main()
{
int countNum,temp,CDnum;
int i;
scanf("%d",&countNum);
CDnum=countNum;
for(i=1;i<countNum+1;i++)
{
scanf("%d",&temp);
if(a[temp])
CDnum--;
else
a[temp]++;
}
printf("%d
",CDnum);
for(i=1;i<MAX;i++)
{
if(a[i])
printf("%d ",i);
}
return 0;
}