#include using namespace std; typedef long long ll; #define pb push_back #define fi first #define se second typedef pair P; using VP = vector

; using VVP = vector; using VI = vector; using VVI = vector; using VVVI = vector; const int inf = 1e9 + 7; const ll INF = 1LL << 61; const ll mod = 1e9 + 7; template inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } template inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int i, j; int n; cin >> n; int m = n / 2; if (n % 2 == 1) { cout << 1 << " " << m + 1 << endl; } else { cout << 2 << " " << m << endl; } cout.flush(); while (1) { int t; cin >> t; if (t <= 2) break; int k, x; cin >> k >> x; if (x > m) { cout << k << x - m - 1 << endl; } else { cout << k << x + m + 1 << endl; } cout.flush(); } }