#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define SZ(x) (int)(x.size()) #define REP(i, n) for(int i=0;i=0;--i) #define RFOR(i, a, b) for(int i=b-1;i>=a;--i) #define all(x) begin(x),end(x) #define dump(x) cerr<<#x<<" = "<<(x)<; using vvi = vector; using vll = vector; using vvll = vector; using P = pair; const double eps = 1e-8; const ll MOD = 1000000007; const int INF = INT_MAX / 2; const ll LINF = LLONG_MAX / 2; template bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; } template bool chmin(T &a, const T &b) { if (b < a) { a = b; return true; } return false; } template ostream &operator<<(ostream &os, const pair p) { os << p.first << ":" << p.second; return os; } template ostream &operator<<(ostream &os, const vector &v) { os << "["; REP(i, SZ(v)) { if (i) os << ", "; os << v[i]; } return os << "]"; } template ostream &operator<<(ostream &os, const map &mp) { os << "["; for (auto it = mp.begin(); it != mp.end(); ++it) { if (it != mp.begin()) { os << ", "; } os << *it; } return os << "]"; } // edit void solve() { int N; cin >> N; if (N % 2 == 1) { cout << 1 << " " << N / 2 + 1 << endl; } else { cout << 2 << " " << N / 2 + 1 << endl; } while (true) { int t; cin >> t; if (t == 0) { break; } int k, x; cin >> k >> x; int dec = N / 2 + 1; cout << k << " " << (x - dec) << endl; } } int main() { // cin.tie(0); // ios::sync_with_stdio(false); // cout << fixed << setprecision(10); // std::ifstream in("input.txt"); // std::cin.rdbuf(in.rdbuf()); solve(); return 0; }