#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; long long MOD = 1000000007; int main() { int x1,x2,y1,y2; x1 = y1 = -1; x2 = y2 = 100001; while ( true ) { int a,b; cout << x1 << " " << 0 << endl; cout << flush; cin >> a; if ( a == 0 ) { return 0; } cout << x2 << " " << 0 << endl; cout << flush; cin >> b; if ( a == 0 ) { return 0; } if ( abs(x1-x2) == 1 ) { x1 = x2 = ( a < b ? x1 : x2 ); break; } if ( a < b ) { x2 = (x1+x2)/2; } else if ( a > b ) { x1 = (x1+x2)/2; } else { x1 = x2 = (x1+x2)/2; break; } } while ( true ) { int a,b; cout << 0 << " " << y1 << endl; cout << flush; cin >> a; if ( a == 0 ) { return 0; } cout << 0 << " " << y2 << endl; cout << flush; cin >> b; if ( a == 0 ) { return 0; } if ( abs(y1-y2) == 1 ) { y1 = y2 = ( a < b ? y1 : y2 ); break; } if ( a < b ) { y2 = (y1+y2)/2; } else if ( a > b ) { y1 = (y1+y2)/2; } else { y1 = y2 = (y1+y2)/2; break; } } cout << x1 << " " << y1 << endl; return 0; }