#include #pragma GCC optimize("O3") #define fi first #define se second #define vi vector #define vpi vector> #define vll vector #define vpll vector> #define si(v) int((v).size()) #define all(v) (v).begin(), (v).end() #define rep(i, n) for (ll i = 0; i < (ll)(n); ++i) #define rep2(i, n, m) for (ll i = n; i <= (ll)(m); ++i) #define rep3(i, n, m) for (ll i = n; i >= (ll)(m); --i) template void chmax(T &a, U b) { if (a < b) a = b; } template void chmin(T &a, U b) { if (a > b) a = b; } using ll = long long; using ld = long double; using namespace std; constexpr ll MOD = 1000000007; signed main() { cout << fixed << setprecision(20); ios::sync_with_stdio(false); cin.tie(0); 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); }