#include <iostream>
#include <cstdio>

using namespace std;

#define DIM 100005

int x, y;

int Sol[DIM];

int main() {
    int N;

    cin >> N;

    if(N == 1) {
        cout << "2 1\n";
        return 0;
    }

    int x = 1, y = 2;

    while(y <= N) {
        cout << 1 << ' ' << x << ' ' << y << '\n';
        cout.flush();

        int sepoate;

        cin >> sepoate;
        if(sepoate == 1) {
            ++y;
        }
        else {
            Sol[++Sol[0]] = x;
            x = y;
            y = x + 1;
        }
    }

    Sol[++Sol[0]] = x;

    cout << 2 << ' ' << Sol[0] << ' ';

    for(int i = 1; i <= Sol[0]; ++i) {
        cout << Sol[i] << ' ';
    }

    cout << '\n';

    return 0;
}