program cc(input,output);
var
a:array[0..1000] of integer;
n,i,x,sum:integer;
begin
assign(input,'random.in');
assign(output,'random.out');
reset(input);
rewrite(output);
readln(n);
for i:=1 to n do
begin
read(x);
if a[x]=0 then sum:=sum+1;
a[x]:=1;
end;
writeln(sum);
for i:=1 to 1000 do
if a[i]=1 then write(i,' ');
close(input);
close(output);
end.