#include #include using namespace std; int main(){ int N; cin >> N; vector d(N, 0); if(N % 2 == 1){ cout << 1 << ' ' << (N + 1) / 2 << endl; } else{ cout << 2 << ' ' << N / 2 << endl; } while(1){ int t; cin >> t; if(t == 0 || t == 1) return 0; int k, x; cin >> k >> x; if(k == 1) cout << k << ' ' << N - x + 1 << endl; else cout << k << ' ' << N - x << endl; } }