program pol; var a,b:array[1..200] of integer; i,j,n,k:integer; f,p:text; begin assign(f,'Palindro.dat'); reset(f); readln(f,n); for i:=1 to n*2-1 do begin read(f,a[i]) end; close(f); { if n div 2<>0 then a[n div 2+1]:=0} i:=1; k:=1; j:=n*2-1; while j<>0 do begin if a[i]<>a[j] then begin b[k]:=a[i]; i:=i+1; k:=k+1 end else i:=i+1; j:=j-1 end; for i:=1 to n do begin if b[i]<>0 then k:=k+1 else k:=k+0 end; k:=k-1; for i:=1 to k do begin if b[i]=b[i-1] then k:=k-1 end; k:=k-1; assign(p,'Palindro.sol'); rewrite(p); writeln(p,k); while k<>0 do begin write(p,b[k],' '); k:=k-1 end; close(p) end.