#include<bits/stdc++.h>

using namespace std;

#define dbg(x) (cout<<#x<<" = "<<(x)<<'\n')

typedef long long int lld;
const int INF = (1LL << 30) - 1;
const lld LINF = (1LL << 62) - 1;

int N;

int main() {
	cin.sync_with_stdio(false);

	#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	#endif

	vector<int> V;

	scanf("%d", &N);

	int lo, mi, hi;
	int ok;
	int L, R = 0;

	while (1) {
		L = R + 1;
		lo = L, hi = N;
		while (lo <= hi) {
			mi = (lo + hi) / 2;
			printf("1 %d %d\n", L, mi);
			fflush(stdout);
			scanf("%d", &ok);
			if (ok) {
				R = mi;
				lo = mi + 1;
			} else
				hi = mi - 1;
		}
		V.push_back(L);
		if (R == N)
			break;

	}

	printf("2 %d ", (int)V.size());
	for (auto x : V)
		printf("%d ", x);
	fflush(stdout);

	return 0;
}