var a:array[-1..201,-1..201] of longint; i,j,k,l,n,m:longint; procedure fill(i,j:integer); begin writeln(i,' ',j); read(a[i,j]); if a[i,j]=0 then halt else if a[i,j]>0 then else begin if a[i+1,j]=0 then fill(i+1,j); if a[i,j+1]=0 then fill(i,j+1); end; end; begin n:=200; for i:=-1 to n+1 do begin a[i,-1]:=2000; a[-1,i]:=2000 ; a[n+1,i]:=2000 ; a[i,n+1]:=2000 ; end; fill(0,0); end.