// 506895 Kiri8128さんの解答を参考 // Python3 -> c++ #include using namespace std; int main(){ int N, t, k, x; cin >> N; if (N % 2 == 0) { cout << 2 << " " << N / 2 << endl; } else { cout << 1 << " " << N / 2 + 1 << endl; } while (1) { cin >> t; if (t <= 1) break; cin >> k >> x; cout << k << " " << N + 2 - x - k << endl; } return 0; }