#include using namespace std; typedef long long ll; #define REP(i,n) for(int i=0,_n=(int)(n);i<_n;++i) #define ALL(v) (v).begin(),(v).end() #define CLR(t,v) memset(t,(v),sizeof(t)) templateostream& operator<<(ostream& os,const pair&a){return os<<"("<void pv(T a,T b){for(T i=a;i!=b;++i)cout<<(*i)<<" ";cout<void chmin(T&a,const T&b){if(a>b)a=b;} templatevoid chmax(T&a,const T&b){if(a read() { int k, x; cin >> k >> x; return {k, x}; } int query(int k, int x) { cout << k << " " << x << endl; int t; cin >> t; return t; } int main() { int N; cin >> N; if (N == 1) { query(1, 1); return 0; } if (N == 2) { query(2, 1); return 0; } int x = (N+1)/2; int t = query(N % 2 ? 1 : 2, x); for (; t == 3 ;) { auto op = read(); int y = op.second + op.first - 1; x = N + 1 - y; t = query(op.first, x); } return 0; }