#include #include #include #include #include #include using namespace std; const int max_point = 1000000000; int query(int x, int y) { cout << x << " " << y << endl; int ret; cin >> ret; return ret; } int main() { int a = query(0, 0); if (a == 0) { return 0; } int b = query(max_point, max_point); if (b == 0) { return 0; } int add = a + b; int sub = a - b; int val, x, y; for (int i = 0; i < 2; i++) { if (i == 0) { x = add; y = sub; } else { x = sub; y = add; } x /= add; y /= sub; if (x < 0 || y < 0) { continue; } for (int j = 0; j < 4; j++) { val = query(x + j / 2, y + j % 2); if (val == 0) { return 0; } } } return 0; }