var x,y,z:Integer;
begin
for x:=1 to 9 do
for y:=0 to 9 do
for z:=0 to 9 do
if 3*(1000+x*100+y*10+z)=x*1000+y*100+z*10+1 then Writeln(1,x,y,z);
Readln;
end.
var x,y,z:Integer;
begin
for x:=1 to 9 do
for y:=0 to 9 do
for z:=0 to 9 do
if 3*(1000+x*100+y*10+z)=x*1000+y*100+z*10+1 then Writeln(1,x,y,z);
Readln;
end.