#include #include void query(int k, int x) { std::cout << k << " " << x << std::endl; } std::pair get() { int t; std::cin >> t; if (t <= 1) std::exit(0); int k, x; std::cin >> k >> x; if (t == 2) std::exit(0); return std::make_pair(k, x); } void solve() { int n; std::cin >> n; if (n % 2 == 0) { query(2, n / 2); } else { query(1, (n + 1) / 2); } while (true) { auto [k, x] = get(); if (k == 1) { query(1, n - x + 1); } else { query(2, n - x); } } } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); solve(); return 0; }