Program random;
Type
sc=array [1..1000] of integer;
Var
x,n,i,j,o:integer;
s:sc;
Begin
assign(input,'random.in');
assign(output,'random.out');
reset(input);
rewrite(output);
readln(n);
o:=0;
for i:=1 to 1000 do s[i]:=0;
for i:=1 to n do begin
read(x);
if s[x]=0 then o:=o+1;
s[x]:=s[x]+1;
end;
writeln(o);
for i:=1 to 1000 do
if s[i]<>0 then write(i,' ');
close(input);
close(output);
End.