program random;
var
i,j,tmp,n:integer;
a:array [0..100] of integer;
flag:boolean;
begin
fillchar (a,sizeof(a),0);
assign (input,'random.in');
reset (input);
readln (n);
for i:=1 to n do begin
read (tmp);flag:=true;
for j:=1 to i-1 do if tmp=a[i] then flag:=false;
if flag then begin
a[i]:=tmp;
inc(a[0]);
end;
end;
close (input);
assign (output,'random.out');
rewrite (output);
writeln (a[0]);
for i:=1 to a[0]-1 do for j:=i+1 to a[0] do if a[i]>a[j] then begin
tmp:=a[i];
a[i]:=a[j];
a[j]:=tmp;
end;
for i:=1 to a[0] do write (a[i],' ');
close (output);
end.