#ifndef _TEMPLATE_ROOT #define _TEMPLATE_ROOT #include "bits/stdc++.h" using namespace std; #define rep(i, a, b) for(int i = a; i < (b); ++i) #define repl(i, a, b) for(ll i = a; i < (b); ++i) #define repd(i, a, b) for(int i = b; i >= (a); --i) #define repdl(i, a, b) for(ll i = b; i >= (a); --i) #define all(x) begin(x), end(x) #define sz(x) (int)(x).size() typedef long long ll; typedef pair pii; typedef vector vi; template bool chmin(H& v1, const H v2) { if (v1 > v2) { v1 = v2; return true; } return false; } template bool chmax(H& v1, const H v2) { if (v1 < v2) { v1 = v2; return true; } return false; } #endif #ifndef _TEMPLATE_IO #define _TEMPLATE_IO template void read(H& head) { cin >> head; } template void read(H& head, T& ...tail) { cin >> head; read(tail...); } template void write(H head) { cout << head << '\n'; } template void write(H head, T ...tail) { cout << head << " "; write(tail...); } template void die(T ...tok) { write(tok...); exit(0); } #endif using namespace std; int main() { cin.tie(0)->sync_with_stdio(0); cin.exceptions(cin.failbit); int n; read(n); if (n % 2 == 1) { write(1, (n + 1) / 2); } else { write(2, n / 2); } cout << flush; int t; cin >> t; while (t != 0) { int k, x; read(k, x); write(k, n + 2 - x - k); cout << flush; cin >> t; } }