#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;

int n;

vector<int> sol;

int poz = 1;

int cauta(int st, int dr) {
    int ans = 0;
    while(st <= dr) {
        int mij = (st + dr) / 2;
        cout << "1 " << poz << ' ' << mij << '\n';
        cout.flush();
        bool good;
        cin >> good;
        if(good) {
            ans = mij;
            st = mij + 1;
        }
        else {
            dr = mij - 1;
        }
    }

    return ans;
}

int main() {
    cin >> n;
    while(poz <= n) {
        int next = cauta(poz, n);
        sol.push_back(poz);
        poz = next + 1;
    }

    cout << 2 << ' ' << sol.size() << ' ';
    for(auto it : sol) {
        cout << it << ' ';
    }
    cout << '\n';
    cout.flush();

    return 0;
}