uses crt;
var
x,y,z: set of 8..22;
i,j:integer;
f:boolean;
begin
clrscr;
x:=[];
writeln('X');
for i:=8 to 22 do
begin
x:=x+[i];
if i in x then write(i,' ');
end;
y:=[];
writeln;
writeln('Y');
for i:=8 to 22 do
begin
f:=true;
for j:=2 to i-1 do
if i mod j=0 then f:=false;
if f=true then y:=y+[i];
if i in y then write(i,' ');
end;
z:=x-y;
writeln;
writeln('Z');
for i:=1 to 22 do
if i in z then write(i,' ');
readln
end.