// #pragma GCC optimize ("Ofast") // #pragma GCC optimize ("unroll-loops") // #pragma GCC target ("avx,avx2,fma") #include using std::cin, std::cout, std::cerr; using ll = long long; int Paint(int k, int x) { cout << k << ' ' << x << '\n'; cout.flush(); int t; cin >> t; return t; } int main() { std::ios::sync_with_stdio(false); int n; cin >> n; int t = Paint(n % 2 == 1 ? 1 : 2, (n + 1) / 2); while(t != 0) { int k, x; cin >> k >> x; int rx = n - x + 1; if(k == 2) rx --; t = Paint(k, rx); } }