var
n,i,sum,j:integer;
s:array[1..1000] of integer;
begin
assign(input,'random.in');
assign(output,'random.out');
reset(input);
rewrite(output);
//while not(eof) do
//begin
readln(n);
fillchar(s,sizeof(s),0);
for i:=1 to n do
begin
read(j);
if s[j]=0 then
begin
inc(s[j]);
inc(sum);
end;
end;
writeln(sum);
for i:=1 to 1000 do
if s[i]=1 then
write(i,' ');
//end;
close(input);
close(output);
end.