program random;
type
fxz=array[1..100]of longint;
var
a:fxz;
f1,f2:text;
i,j,c,n:longint;
begin
assign(f1,'random.in');
assign(f2,'random.out');
reset(f1);rewrite(f2);
readln(f1,n);
for i:=1 to n do
read(f1,a[i]);
for i:=1 to n-1 do
for j:=i to n do
if a[j]>=a[i] then
begin c:=a[i];a[i]:=a[j];a[j]:=c;end;
i:=2;
repeat
if a[i]=a[i-1] then
begin for j:=i to n-1 do
a[j]:=a[j+1];
dec(n);
end
else inc(i);
until i>n;
writeln(f2,n);
for i:=n downto 1 do write(f2,a[i],' ');
close(f1);close(f2);
end.