#include #include #include #include #include #define REP(i, n) for (ll i = 0; i < n; i++) #define REP1(i, n) for (ll i = 1; i <= n; i++) #define RREP(i, n) for (ll i = n - 1; i >= 0; i--) #define RREP1(i, n) for (ll i = n; i >= 1; i--) #define FOR(i, a, b, c) for (ll i = a; i <= b; i += c) #define RFOR(i, a, b, c) for (ll i = a; i >= b; i -= c) #define MAX(a, b) (a > b ? a : b) #define MIN(a, b) (a < b ? a : b) #define INF 1145141919 typedef long long ll; int ask(int x, int y) { printf("%d %d\n", x, y); fflush(stdout); int d; scanf("%d", &d); if (d == 0) exit(0); return d; } int main() { int ax, ay; int top = 0, tail = 1000000000; int d1, d2, asked = 0; while (true) { if (asked != 1) d1 = ask(top, 0); if (asked != 2) d2 = ask(tail, 0); if (d1 < d2) { tail = (top + tail) / 2; asked = 1; } else { top = (top + tail) / 2; asked = 2; } if (tail - top <= 2) { ax = d1 == d2 ? (tail + 1) : (d1 < d2 ? top : tail); break; } } ay = MIN(d1, d2); ask(ax, ay); return 1; }