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