program cogs74;
const
maxn=110;
var
t,x,i,j,n:longint;
a:array[1..maxn] of longint;
f:array[1..1000] of boolean;
procedure kp(l,r:longint);
var
i,j,x,t:longint;
begin
i:=l; j:=r;
x:=a[(l+r) div 2];
repeat
while a[i]<x do inc(i);
while a[j]>x do dec(j);
if i<=j then
begin
t:=a[i]; a[i]:=a[j]; a[j]:=t;
inc(i); dec(j);
end;
until i>j ;
if i<r then kp(i,r);
if j>l then kp(l,j);
end;
begin
assign(input,'random.in'); reset(input);
assign(output,'random.out'); rewrite(output);
readln(n);
for i:=1 to 1000 do f[i]:=false;
t:=0;
for i:=1 to n do
begin
read(x);
if not f[x] then
begin
inc(t);
a[t]:=x;
f[x]:=true;
end;
end;
kp(1,t);
writeln(t);
for i:=1 to t-1 do write(a[i],' ');
write(a[t]);
close(input); close(output);
end.