program random;
const maxn=1000;
var a:array[1..maxn]of boolean;
i,n,x,max:longint;
procedure first;
begin
assign(input,'random.in');
assign(output,'random.out');
reset(input);rewrite(output);
end;
Begin
first;
readln(n);max:=0;
fillchar(a,sizeof(a),0);
for i:=1 to n do
begin
read(x);
a[x]:=true;
if max<x then max:=x;
end;
n:=0;
for i:=1 to max do if a[i] then inc(n);
writeln(n);
for i:=1 to max-1 do
if a[i] then write(i,' ');
if max<>0 then writeln(max);
close(input);close(output);
end.