#include using namespace std; int main() { int N; cin >> N; if (N % 2 == 0) { cout << 2 << " " << N / 2 << endl; while (true) { int t; cin >> t; if (t == 3) { int k, x; cin >> k >> x; if (k == 1) cout << 1 << " " << N + 1 - x << endl; else cout << 2 << " " << N - x << endl; } else { return 0; } } } else { cout << 1 << " " << N / 2 + 1 << endl; while (true) { int t; cin >> t; if (t == 3) { int k, x; cin >> k >> x; if (k == 1) cout << 1 << " " << N + 1 - x << endl; else cout << 2 << " " << N - x << endl; } else { return 0; } } } }