var i,num1,num2,num3:integer;
begin
for i:=1 to 167 do
begin
num1:=300 mod i;
num2:=205 mod i;
num3:=167 mod i;
if (num1=num2)and(num2=num3) then
writeln(i,' ',num1);
end;
end.
var i,num1,num2,num3:integer;
begin
for i:=1 to 167 do
begin
num1:=300 mod i;
num2:=205 mod i;
num3:=167 mod i;
if (num1=num2)and(num2=num3) then
writeln(i,' ',num1);
end;
end.