#include"stdio.h"
#include"stdlib.h"
#include"iostream.h"
using namespace std;
int cmp(const void *num,const void *num1)
{
return *(int *)num-*(int *)num1;
}
int main()
{
int num[101],num1[101]={0};
int N,k=0,M;
while(scanf("%d",&N)!=EOF)
{
M=N;
for(int i=0;i<N;i++)
scanf("%d",&num[i]);
qsort(num,N,sizeof(num[0]),cmp);
N = unique( num,num+N ) - num;
printf("%d\n",N);
for(int i=0;i<N;i++)
printf("%d\n",num[i]);
}
//system("pause");
return 0;
}