program random;
var
n,k:integer;
a:array[1..100]of integer;
b:array[1..1000]of boolean;
procedure ini;
var
i:integer;
begin
assign(input,'random.in');
reset(input);
assign(output,'random.out');
rewrite(output);
readln(n);
for i:=1 to n do read(a[i]);
close(input);
k:=0;
end;
procedure main;
var
i:integer;
begin
fillchar(b,sizeof(b),false);
for i:=1 to n do b[a[i]]:=true;
for i:=1 to 1000 do
if b[i]=true then inc(k);
end;
procedure print;
var
i:integer;
begin
writeln(k);
for i:=1 to 1000 do
if b[i]=true then write(i,' ');
close(output);
end;
begin
ini;
main;
print;
end.