#include <iostream>

using namespace std;

int o[201][201];

int main()
{
    int x;

    cout << "0 0" << '\n';
    cout.flush();
    cin >> o[0][0];
    cout << "199 199" << '\n';
    cout.flush();
    cin >> o[199][199];

    if(o[0][0]==0)
        return 0;
    if(o[199][199]==0)
        return 0;

    int i=0;
    int j=0;

    if(0-o[0][0]=>o[199][199])
    {
        while(i<=199 && j<=199)
        {
            j++;
            cout << "0 " << j << '\n';
            cout.flush();
            cin >> o[0][j];
            if(o[0][j]>0)
            {
                j--;
                x=-1;
                while(x!=0)
                {
                    cout << i+1 << j << '\n';
                    cout.flush();
                    cin >> x;
                    i++;
                }
                return 0;
            }
            if(o[0][j]==0)
                return 0;
            if(o[0][j]<0)
                j++;

            i++;
            cout << i << " 0" << '\n';
            cin >> o[i][0];
            if(o[i][0]>0)
            {
                i--;
                x=-1;
                while(x!=0)
                {
                    cout << i << j+1 << '\n';
                    cout.flush();
                    cin >> x;
                    j++;
                }
                return 0;
            }
            if(o[i][0]==0)
                return 0;
            if(o[i][0]<0)
                i++;
        }

        if(o[0][j]>o[i][0])
        {
            while(x!=0)
            {
                cout << i+1 << j << '\n';
                cout.flush();
                cin >> x;
                i++;
            }
            return 0;
        }
        else
        {
            while(x!=0)
            {
                cout << i << j+1 << '\n';
                cout.flush();
                cin >> x;
                j++;
            }
            return 0;
        }
    }
    else
    {
        while(i>=0 && j>=0)
        {
            j--;
            cout << "199 " << j << '\n';
            cout.flush();
            cin >> o[199][j];
            if(o[199][j]>0)
            {
                j++;
                x=-1;
                while(x!=0)
                {
                    cout << i-1 << j << '\n';
                    cout.flush();
                    cin >> x;
                    i--;
                }
                return 0;
            }
            if(o[199][j]==0)
                return 0;
            if(o[199][j]<0)
                j--;

            i--;
            cout << i << " 199" << '\n';
            cin >> o[i][199];
            if(o[i][199]>0)
            {
                i++;
                x=-1;
                while(x!=0)
                {
                    cout << i << j-1 << '\n';
                    cout.flush();
                    cin >> x;
                    j--;
                }
                return 0;
            }
            if(o[i][199]==0)
                return 0;
            if(o[i][199]<0)
                i--;
        }

        if(o[199][j]>o[i][199])
        {
            while(x!=0)
            {
                cout << i-1 << j << '\n';
                cout.flush();
                cin >> x;
                i--;
            }
            return 0;
        }
        else
        {
            while(x!=0)
            {
                cout << i << j-1 << '\n';
                cout.flush();
                cin >> x;
                j--;
            }
            return 0;
        }
    }

    return 0;
}