#include <iostream>

using namespace std;

int main()
{
    const int N = 200;

    ios_base::sync_with_stdio(false);

    for (int i = 0; i < N; ++i)
        for (int j = 0; j < N; ++j)
        {
            cout << i << " " << j << "\n";
            cout.flush();

            int h;
            cin >> h;

            if (h == 0)
                return 0;
        }

    return 0;
}