#include using namespace std; #define FOR(i,l,r) for(int i = (int) (l);i < (int) (r);i++) #define ALL(x) x.begin(),x.end() template bool chmax(T& a,const T& b){ return a < b ? (a = b,true) : false; } template bool chmin(T& a,const T& b){ return b < a ? (a = b,true) : false; } typedef long long ll; const int MAX = 100000; int main() { int loX = 0,hiX = MAX + 1,loY = 0,hiY = MAX + 1; while(hiX - loX > 1){ int mid = (loX + hiX) / 2; int res1,res2; printf("%d %d\n",mid,loY); fflush(stdout); scanf("%d",&res1); printf("%d %d\n",mid - 1,loY); fflush(stdout); scanf("%d",&res2); if(res1 <= res2){ loX = mid; } else{ hiX = mid; } } while(hiY - loY > 1){ int mid = (loY + hiY) / 2; int res1,res2; printf("%d %d\n",loX,mid); fflush(stdout); scanf("%d",&res1); printf("%d %d\n",loX,mid - 1); fflush(stdout); scanf("%d",&res2); if(res1 <= res2){ loY = mid; } else{ hiY = mid; } } printf("%d %d\n",loX,loY); fflush(stdout); return 0; }