#include using namespace std; using ll = long long; constexpr char newl = '\n'; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int n; cin >> n; if (n & 1) { cout << 1 << " " << (n + 1) / 2 << endl; } else { cout << 2 << " " << n / 2 << endl; } while (true) { int t; cin >> t; if (t <= 1) break; int k, x; cin >> k >> x; if (t == 2) break; cout << k << " " << x + (x < (n + 1) / 2 ? 1 : -1) * (n / 2 + 1) << endl; } return 0; }