// RandomUsername (Nikola Jovanovic) // MindCoding Round 2 // C #include #define DBG false #define debug(x) if(DBG) printf("(ln %d) %s = %d\n", __LINE__, #x, x); #define lld long long #define ff(i,a,b) for(int i=a; i<=b; i++) #define fb(i,a,b) for(int i=a; i>=b; i--) #define par pair #define fi first #define se second #define mid (l+r)/2 #define INF 1000000000 #define MAXN 100005 using namespace std; int n; vector out; bool F(int x, int y) { int res; printf("1 %d %d\n", x, y); fflush(stdout); scanf("%d", &res); return res; } int main() { scanf("%d", &n); int L = 1; while(L <= n) { int hi = n; int lo = L; int pivot; // last possible while(hi > lo) { pivot = (hi + lo) / 2 + 1; bool ok = F(L, pivot); if(ok) { lo = pivot; } else { hi = pivot - 1; } } out.push_back(L); L = hi + 1; } int sz = (int)out.size(); printf("%d %d ", 2, sz); ff(i, 0, sz - 1) printf("%d ", out[i]); return 0; }