#include using namespace std; int main() { int n; cin >> n; if(n % 2 == 1) { cout << 1 << " " << n / 2 + 1 << '\n'; } else { cout << 2 << " " << n / 2 << '\n'; } cout.flush(); while(true) { int t; cin >> t; if(t != 3) { return 0; } int k, x; cin >> k >> x; int a = n + 1 - x; if(k == 2) { --a; } cout << k << " " << a << '\n'; cout.flush(); } return 0; }