program a;
const n=200;
var s,p:set of 2..n;
nxt,j,t:integer;
begin
s:=[2..n];p:=[];
nxt:=2;t:=0;
repeat
while not(nxt in s) do
nxt:=succ(nxt);
p:=p+[nxt];j:=nxt;
while j<=n do begin
s:=s-[j];inc(j,nxt);
end;
if nxt in p then begin
inc(t);write(nxt:6);
end;
until s=[];
end.
const n=200;
var s,p:set of 2..n;
nxt,j,t:integer;
begin
s:=[2..n];p:=[];
nxt:=2;t:=0;
repeat
while not(nxt in s) do
nxt:=succ(nxt);
p:=p+[nxt];j:=nxt;
while j<=n do begin
s:=s-[j];inc(j,nxt);
end;
if nxt in p then begin
inc(t);write(nxt:6);
end;
until s=[];
end.