#include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; #define int long long #define double long double typedef vector VI; typedef pair pii; typedef vector VP; typedef vector VS; typedef priority_queue PQ; templatebool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } templatebool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; } #define fore(i,a) for(auto &i:a) #define REP(i,n) for(int i=0;i, greater > q2; signed main() { cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; if (N % 2) { cout << N / 2 << " " << 1 << endl; } else { cout << N / 2 << " " << 2 << endl; } while (1) { int t; cin >> t; if (t == 0)return 0; int k, x; cin >> k >> x; if (k > N / 2) { cout<< k - N / 2 - 1 << " " << x << endl; } else { cout << k + N / 2 + 1 << " " << x << endl; } } return 0; }