/*** author: yuji9511 ***/ #include using namespace std; using ll = long long; using lpair = pair; const ll MOD = 1e9+7; const ll INF = 1e18; #define rep(i,m,n) for(ll i=(m);i<(n);i++) #define rrep(i,m,n) for(ll i=(m);i>=(n);i--) #define printa(x,n) for(ll i=0;i void print(H&& h, T&&... t){cout<(t)...);} void solve(){ ll N; cin >> N; ll state[110] = {}; state[N] = 1; while(true){ ll K = -1,X = -1; ll num = 0; ll cnt = 0; bool end = false; // printa(state,N); rep(i,0,N){ rep(k,1,3){ if(state[i] == 1) continue; if(k == 2 && state[i+1] == 1) continue; rep(j,i,i+k){ state[j] = 1; } ll num = 0, res = 0; rep(j,0,N+1){ if(state[j] == 0){ num++; }else{ if(num > 0){ res ^= num; num = 0; } } } rep(j,i,i+k){ state[j] = 0; } if(res == 0){ end = true; // print("ok",k,i); K = k; X = i; break; } } if(end) break; } rep(i,X,X+K){ state[i] = 1; } cout << K << " " << X+1 << endl; ll t; cin >> t; if(t == 0 || t == 2){ return; }else if(t == 1){ exit(1); }else{ ll k,x; cin >> k >> x; if(k == 1){ state[x-1] = 1; }else{ state[x-1] = 1; state[x] = 1; } } } } int main(){ cin.tie(0); ios::sync_with_stdio(false); solve(); }