// NOTE: it is recommended to use this even if you don't understand the following code.
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>

// input data
int N;

int main() {
    // uncomment the following lines if you want to read/write from files
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);

    assert(1 == scanf("%d", &N));
    int grasshopper_x = 0, grasshopper_y = 0;
    do {
        int trap_x = 2, trap_y = 2;

        // insert your code here

        printf("%d %d\n", trap_x, trap_y);
        fflush(stdout);

        assert(2 == scanf("%d %d", &grasshopper_x, &grasshopper_y));
        if (grasshopper_x == -1 && grasshopper_y == -1) {
            break;
        }
    } while (1);

    return 0;
}
