#include #include #include #include #include #include #include #include #include static const int MOD = 1000000007; using ll = long long; using u32 = unsigned; using u64 = unsigned long long; using namespace std; template constexpr T INF = ::numeric_limits::max() / 32 * 15 + 208; int main() { int n; cin >> n; auto answer = [&](int a, int b){ cout << a << " " << b << endl; }; if(n%2) answer(1, n/2+1); else answer(2, n/2); int t, k, x; auto get = [&](){ cin >> t; if(t >= 2) cin >> k >> x; return t >= 2; }; while(get()){ if(k == 1) answer(1, n-x+1); else answer(2, n-x); } return 0; }