#include<iostream>
using namespace std;
int t[205][205];
#define pozi 2
#define negat 1
inline int elojelvalt(int &i,int &j)
{
	if(t[i][j]==pozi)
	{
		if(t[i-1][j]==negat)
		{
			i=i-1;
			return 2;
		}
		if(t[i-1][j-1]==negat)
		{
			i=i-1;
			j=j-1;
			return 3;
		}
		if(t[i][j-1]==negat)
		{
			j=j-1;
			return 4;
		}
	}
	else if(t[i][j]==negat)
	{
		if(t[i+1][j]==pozi)
			return 2;
		if(t[i+1][j+1]==pozi)
			return 3;
		if(t[i][j+1]==pozi)
			return 4;
	}
	return 1;
}
bool meg=0;
int keresValt(int a,int b,int c,int d,int &i,int &j)
{
	int x,y,v;
	x=(c+a)/2;
	y=(d+b)/2;
	do
	{
		cout<<x<<" "<<y<<"\n";
		cout.flush();
		cin>>v;
		t[x][y]=(v>0)+1;
		if(v<0)
		{
			a=x;
			b=y;
			if(a<c)
				++a;
			if(b<d)
				++b;
		}
		else if(v>0){
			c=x;
			d=y;
			if(a<c)
				--c;
			if(b<d)
				--d;
		}
		else
		{
			meg=1;
			return 0;
		}
		x=(c+a)/2;
		y=(d+b)/2;
		if(t[x][y]!=0)
		{
			i=x;
			j=y;
			return elojelvalt(i,j);
		}
	} while(1);
}
void ker(int a,int b,int c,int d)
{
	if(a<=c&&b<=d)
	{
		int i,j;
		int v=keresValt(a,b,c,d,i,j);
		if(v>=2)
		{
			if(v==2)
			{
				ker(a,j+1,i,d);
				if(!meg)
					ker(i+1,b,c,j-1);
			}
			else if(v==3)
			{
				ker(a,j+1,i,d);
				if(!meg)
					ker(i+1,b,c,j);
			}
			else
			{
				ker(a,j+1,i-1,d);
				if(!meg)
					ker(i+1,b,c,j);
			}
		}
	}
}
int main()
{
	ker(1,1,200,200);
	return 0;
}