#include <vector>
#include <iostream>

using namespace std;

int N;

bool Ask(int x, int y) {
//	cout << 1 << ' ' << x << ' ' << y << '\n';
	printf("1 %d %d\n", x, y);
//	cout.flush();
	fflush(stdout);
//	cin >> x;
	scanf("%d", &x);
	return x;
}

int main(){
	int i;
	vector <int> ans;
//	cin >> N;
	scanf("%d", &N);
	fflush(stdout);
	ans.push_back(1);
	for (i = 1; i < N; ++i) {
		while (i < N && Ask(i, i + 1)) {
			++i;
		}
		if (i < N) {
			ans.push_back(i + 1);
		}
	}
	
	printf("2 %d", ans.size());
	
//	cout << 2 << ' ';
//	cout << ans.size() << ' ';
	for (auto x: ans) {
//		cout << x << ' ';
		printf(" %d", x);
	}
//	cout << '\n';
	printf("\n");
	fflush(stdout);
	return 0;
}