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