const
maxnum=10010;
type
tdata=array[0..maxnum] of boolean;
var
data:tdata;
n,i,x,vans:longint;
begin
assign(input,'random.in');
reset(input);
assign(output,'random.out');
rewrite(output);
readln(n);
fillchar(data,sizeof(data),false);
vans:=0;
for i:=1 to n do
begin
read(x);
if (not(data[x])) then
begin
inc(vans);
data[x]:=true;
end;
end;
writeln(vans);
for i:=1 to maxnum do
if (data[i]) then
write(i,' ');
writeln;
close(input);
close(output);
end.