Program random;
Type
sc=array [1..1000] of integer;
Var
s:sc;
i,x,n,m:integer;
f1,f2:text;
Begin
assign(f1,'random.in');
assign(f2,'random.out');
reset(f1);
rewrite(f2);
readln(f1,n);
for i:=1 to 1000 do s[i]:=0;
m:=n;
for i:=1 to n do begin
read(f1,x);
if s[x]=1 then m:=m-1
else s[x]:=1;
end;
writeln(f2,m);
for i:=1 to 1000 do
if s[i]=1 then write(f2,i,' ');
close(f1);
close(f2);
End.