#include <iostream> #include <stdlib.h> using namespace std; int n,i,j,v,x; int cautx(int a,int b) { int m=(a+b)>>1; if (a==b) return a; else { cout<<m<<" 0\n"; cout.flush(); cin>>v; if (v<0) return cautx(m+1,b); else { if (v==0) exit(0); return cautx(a,m); } } } void cauty(int l,int a,int b) { int m=(a+b)>>1; if (a==b) { cout<<l<<" "<<a<<'\n'; cout.flush(); exit(0); } else { cout<<l<<" "<<m<<'\n'; cout.flush(); cin>>v; if (v==0) exit(0); if (v<0) cauty(l,m+1,b); else cauty(l,a,m); } } int main() { n=3; x=cautx(0,n-1); cout<<x<<" 0\n"; cout.flush(); cin>>v; if (v==0) exit(0); if (v>0) x--; cout<<x<<" "<<n-1<<'\n'; cout.flush(); cin>>v; if (v<0) cauty(x+1,0,n-1); else { if (v==0) exit(0); else cauty(x,0,n-1); } return 0; }