program cojs74;
var
a:array[0..1010] of longint;
i,j,k,m,n:longint;
begin
assign(input,'random.in');
assign(output,'random.out');
reset(input);
rewrite(output);
fillchar(a,sizeof(a),0);
readln(n);
m:=0;
for i:=1 to n do
begin
read(k);
if a[k]=0 then inc(m);
a[k]:=1;
end;
writeln(m);
for i:=1 to 1000 do
if a[i]<>0 then
write(i,' ');
writeln;
close(input);
close(output);
end.