var
n,nm,ans:longint;
a,b:array [0..1001] of longint;
prime:array [0..10000001] of longint;
v:array [0..30000001] of longint;
procedure qsort1(l,r:longint);
var
i,j,mid,t:longint;
begin
if l>r then exit;
i:=l; j:=r;
mid:=a[(l+r) div 2];
repeat
while a[i]>mid do inc(i);
while a[j]<mid 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;
qsort1(i,r);
qsort1(l,j);
end;
procedure qsort2(l,r:longint);
var
i,j,mid,t:longint;
begin
if l>r then exit;
i:=l; j:=r;
mid:=b[(l+r) div 2];
repeat
while b[i]>mid do inc(i);
while b[j]<mid do dec(j);
if i<=j then
begin
t:=b[i]; b[i]:=b[j]; b[j]:=t;
inc(i); dec(j);
end;
until i>j;
qsort2(i,r);
qsort2(l,j);
end;
procedure try1;
var
i,j:longint;
begin
// fillchar(v,sizeof(v),0);
nm:=0;
v[1]:=1;
for i:=2 to 30000000 do
begin
if v[i]=0 then
begin
inc(nm);
prime[nm]:=i;
end;
j:=1;
while (j<=nm) and (i*prime[j]<=30000000) do
begin
v[i*prime[j]]:=1;
if i mod prime[j]=0 then break;
inc(j);
end;
end;
end;
procedure init;
var
i,x:longint;
begin
readln(n);
a[0]:=0; b[0]:=0;
for i:=1 to n do
begin
read(x);
if x mod 2=0 then
begin
inc(a[0]); a[a[0]]:=x;
end else
begin
inc(b[0]); b[b[0]]:=x;
end;
end;
qsort1(1,a[0]);
qsort2(1,b[0]);
end;
procedure main;
var
i,j,tk,t,num1,num2,num:longint;
begin
tk:=0; i:=b[0];
while b[i]=1 do
begin
dec(i); inc(tk);
end;
if tk<2 then
begin
ans:=0;
for i:=1 to a[0] do
for j:=1 to b[0] do
begin
num:=a[i]+b[j];
if (v[num]=0) and (num>ans) then
begin
ans:=num;
num1:=a[i]; num2:=b[j];
break;
end;
end;
if num1>num2 then
begin
t:=num1; num1:=num2; num2:=t;
end;
if ans<>0 then
begin
writeln('2');
writeln(num1,' ',num2);
end else write('0');
end else
begin
ans:=0;
for i:=1 to a[0] do
if v[a[i]+1]=0 then
begin
ans:=a[i]; break;
end;
if ans<>0 then writeln(tk+1)
else writeln(tk);
for i:=1 to tk do
write('1 ');
if ans<>0 then write(ans);
end;
end;
begin
try1;
init;
main;
end.