#include #define rep(i,n) for(int i = 0; i < (n); i++) using namespace std; typedef long long ll; int main(){ cin.tie(0); ios::sync_with_stdio(0); int N; cin >> N; if(N % 2 == 0) { cout << 2 << " " << N / 2 << endl; } else { cout << 1 << " " << (N + 1) / 2 << endl; } cout.flush(); while(true) { int t; cin >> t; if(t == 0 || t == 1) return 0; int k,x; cin >> k >> x; if(t == 2) return 0; assert(t == 3); if(k == 2) x++; x = N + 1 - x; cout << k << " " << x << endl; cout.flush(); } }