program doi; var n,i,k:integer; a,b:longint; superprim: boolean; function prim(n:integer):boolean; var i:integer; begin prim:=true; for i:=2 to n-1 do if n mod i=0 then prim:=false; end; begin write('n='); readln(n); k:=0; a:=2; repeat b:=a; superprim:=true; while b>0 do begin if prim(b)= false then superprim:=false; b:=b div 10; end; if superprim= true then begin k:=k+1; write(a,' '); end; a:=a+1; until k=n; readln; end.