#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define rep(i,a,n) for(int (i)=(a); (i)<(n); (i)++) #define repq(i,a,n) for(int (i)=(a); (i)<=(n); (i)++) #define repr(i,a,n) for(int (i)=(a); (i)>=(n); (i)--) #define all(v) begin(v), end(v) #define pb(a) push_back(a) #define fr first #define sc second #define INF 2000000000 #define int long long int #define X real() #define Y imag() #define EPS (1e-10) #define EQ(a,b) (abs((a) - (b)) < EPS) #define EQV(a,b) ( EQ((a).X, (b).X) && EQ((a).Y, (b).Y) ) #define LE(n, m) ((n) < (m) + EPS) #define LEQ(n, m) ((n) <= (m) + EPS) #define GE(n, m) ((n) + EPS > (m)) #define GEQ(n, m) ((n) + EPS >= (m)) typedef vector VI; typedef vector MAT; typedef pair pii; typedef long long ll; typedef complex P; typedef pair L; typedef pair C; int dx[]={1, -1, 0, 0}; int dy[]={0, 0, 1, -1}; int const MOD = 1000000007; ll mod_pow(ll x, ll n) {return (!n)?1:(mod_pow((x*x)%MOD,n/2)*((n&1)?x:1))%MOD;} int madd(int a, int b) {return (a + b) % MOD;} int msub(int a, int b) {return (a - b + MOD) % MOD;} int mmul(int a, int b) {return (a * b) % MOD;} int minv(int a) {return mod_pow(a, MOD-2);} int mdiv(int a, int b) {return mmul(a, minv(b));} namespace std { bool operator<(const P& a, const P& b) { return a.X != b.X ? a.X < b.X : a.Y < b.Y; } } signed main() { int ubx = 100010, lbx = 0, uby = 100010, lby = 0; while(ubx - lbx > 1) { int l = (ubx + 2*lbx) / 3; int r = (2*ubx + lbx) / 3; int kl, kr; cout << l << " " << 0 << endl; cin >> kl; cout << r << " " << 0 << endl; cin >> kr; if(r - l <= 1) { if(kl > kr) lbx = r; else lbx = l; break; } if(kl < kr) { ubx = r; } else { lbx = l; } } while(uby - lby > 1) { int r = (2*uby + lby) / 3; int l = (uby + 2*lby) / 3; int kl, kr; cout << lbx << " " << l << endl; cin >> kl; cout << lbx << " " << r << endl; cin >> kr; if(r - l <= 1) { if(kl > kr) lby = r; else lby = l; break; } if(kl < kr) { uby = r; } else { lby = l; } if(r - l <= 1) break; } int ans; cout << lbx << " " << lby << endl; cin >> ans; return 0; }