//Dragan Andrei Gabriel
//University of Bucharest

#include <cstdio>
#include <cassert>
#include <cmath>
#include <cstring>
#include <ctime>
#include <cstdlib>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <istream>
#include <ostream>
#include <deque>
#include <map>
#include <queue>
#include <stack>
#include <set>
#include <vector>
#include <algorithm>
#include <functional>
#include <string>
#include <utility>
using namespace std;

int n, m, x, y, v[201][201], t;

int main()
{
    #ifndef ONLINE_JUDGE
    freopen("a.in", "r", stdin);
    freopen("a.out", "w", stdout);
    #endif

    t = 1000;
    x = y = 100;
    while (t != 0)
    {
        printf("%d %d\n", x, y);
        fflush(stdout);

        scanf("%d", &t);
        fflush(stdout);

        v[x][y] = t;

  /*      if (t > 0)
        {
            for (int i = x + 1; i < 200; i++)
                for (int j = 1; j < 200; j++)
                    v[i][j] = t;
            for (int i = 0; i < 200; i++)
                for (int j = y + 1; j < 200; j++)
                    v[i][j] = t;
        }
        else
            if (t < 0)
            {
                for (int i = 0; i < x; i++)
                    for (int j = 0; j < y; j++)
                        v[i][j] = t;
            }


        if (v[x / 2][y / 2] == 0)
        {
            x /= 2;
            y /= 2;
            continue;
        }
        if (v[x * 2][y * 2] == 0 && x * 2  < 200 && y * 2 < 200)
        {
            x *= 2;
            y *= 2;
            continue;
        }
        if (v[x / 2][y] == 0)
        {
            x /= 2;
            continue;
        }
        if (v[x][y / 2] == 0)
        {
            x /= 2;
            continue;
        }
*/        for (int i = 0; i < 200; i++)
            for (int j = 0; j < 200; j++)
                if (v[i][j] == 0)
                {
                    x = i;
                    y = j;
                    continue;
                }

    }

    return 0;
}