#include using namespace std; typedef long long ll; typedef long double ld; typedef pair Pii; typedef pair Pil; typedef pair Pll; typedef pair Pli; #define fi first #define se second const ll MOD = 1e9 + 7; const ll MOD2 = 998244353; const ll MOD3 = 1812447359; const ll INF = 1ll << 62; const double PI = 2 * asin(1); void yes() {printf("yes\n");} void no() {printf("no\n");} void Yes() {printf("Yes\n");} void No() {printf("No\n");} void YES() {printf("YES\n");} void NO() {printf("NO\n");} int N, Rest; bool visited[105]; int Count(){ int cnt = 0; if (!visited[1]) cnt++; for (int i = 2; i <= N; i++){ if (!visited[i] && visited[i-1]) cnt++; } return cnt; } int Solve(){ for (int i = 1; i <= N; i++){ if (visited[i]) continue; visited[i] = true; if (Count() % 2 == 0){ Rest--; cout << "1 " << i << endl; return 0; } visited[i] = false; } for (int i = 1; i < N; i++){ if (visited[i] || visited[i+1]) continue; visited[i] = true; visited[i+1] = true; if (Count() % 2 == 0){ Rest-=2; cout << "2 " << i << endl; return 0; } visited[i] = false; visited[i+1] = false; } return 0; } int main(){ cin >> N; for (int i = 0; i < N; i++){ Solve(); int T; cin >> T; if (T != 3) break; int K, X; cin >> K >> X; for (int j = 0; j < K; j++){ visited[X + i] = true; } } return 0; }