#include using namespace std; #include vector ans; int f(int x, int y) { printf("1 %d %d\n", x, y); fflush(stdout); int ans; scanf("%d", &ans); return ans; } int main() { int n, i, res, step; scanf("%d", &n); i = 1; while (i <= n) { ans.push_back(i); if (i < n && f(i, i + 1) == 0) ++i; else if (i < n) { step = 2; while (step + i <= n && f(i, i + step)) step <<= 1; step >>= 1; res = i + step; step >>= 1; while (step) { if (res + step <= n && f(i, step + res)) res += step; step >>= 1; } i = res + 1; } else ++i; } printf("2 %d", ans.size()); for (i = 0; i < ans.size(); ++i) printf(" %d", ans[i]); printf("\n"); fflush(stdout); return 0; }