uses crt;
var i,n,dem:longint; a:array[1..1000000]of longint;
function nt(a:longint):boolean;
var i:longint;
begin
i:=2;
while(a>1)and(a mod i<>0) do inc(i);
nt:=i=a;
end;
begin
clrscr;
write('N=');readln(n);
for i:=1 to n do
begin
write('a[',i,']=');readln(a[i]);
if nt(a[i]) then inc(dem);
end;
if dem=0 then writeln('Khong co phan tu la so nguyen to trong mang.') else
writeln('Cac so nguyen to: ');
for i:=1 to n do if nt(a[i]) then write(a[i],' ');
readln
end.