program mingming;
var
tong:array[1..1000] of longint;
n,i,x,geshu:longint;
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 tong[x]=0 then
begin
inc(geshu);
inc(tong[x]);
end;
end;
writeln(geshu);
for i:=1 to 1000 do
if tong[i]<>0 then
write(i,' ');
writeln;
close(input);
close(output);
end.