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