var
a:array[1..47]of longint;
x,i,y:longint;
f:boolean;
function check:boolean;
var
i:longint;
begin
check:=true;
for i:=1 to 47 do
if a[i]=0 then exit(false);
end;
begin
a[35]:=1;a[4]:=1;a[22]:=1;
randomize;f:=false;
while check=false do
begin
y:=random(10)+1;
if (y=2)and(f=false) then begin f:=true;writeln('4 22');end;
for i:=1 to 2 do
begin
repeat
x:=random(47)+1;
until a[x]=0;
write(x,' ');
a[x]:=1;
end;
writeln;
end;
end.