#include #define rep(i,n) for(int i=(0);i<(n);i++) using namespace std; typedef long long ll; int main(){ cin.tie(0); ios::sync_with_stdio(false); int lx = -1, rx = 1e7; auto calc = [](int x, int y){ cout << x << " " << y; int d; cin >> d; if(d == 0) exit(0); return d; }; while(rx - lx > 1){ int mx = (lx + rx) / 2; (calc(mx, 0) - calc(mx-1, 0) > 0 ? rx : lx) = mx; } int ly = -1, ry = 1e7; while(ry - ly > 1){ int my = (ly + ry) / 2; (calc(lx, my) - calc(lx, my-1) > 0 ? ry : ly) = my; } cout << lx << " " << ly << endl; }