#include <stdio.h>
#include <stdlib.h>
#include <math.h>
void main()
{
int m[100]={0};
int count,n,a,i,j,k,l;
int count1=0;
char ch;
i=0;
scanf("%d",&n);
do
{
count=0;
scanf("%d%c",&a,&ch);
for(j=0;j<i;j++) if(m[j]==a) count++;//去重
if(count==0)
{
m[i]=a;
i++;
}
count1++;
}while(count1<n);
for(k=0,j=i/2;j!=0;j/=2)//排序
{
l=0;
while(m[j+l]!=0)
{
if(m[k+l]>m[j+l]) {a=m[k+l],m[k+l]=m[j+l];m[j+l]=a;}
l++;
}
}
printf("%d\n",i);
for(j=0;j<i;j++) printf("%d ",m[j]);
printf("\n");
system("pause");
}