#include<iostream>
using namespace std;
const int Nmax = 100100;
int N,d[Nmax][20],a[Nmax];
int q(int x,int y){
    cout<<1<<' '<<x<<' '<<y<<'\n';
    cout.flush();
    int t; cin>>t;
    return t;
}
int main(){
    cin>>N;
    int i=1,K=0;
    a[++K]=i;
    while(i<=N){
        int pas=1<<18;
        int st=i;
        while(pas){
            while( i+pas<=N && q(st,i+pas) ) i+=pas;
            pas>>=2;
        }
        a[++K]=++i;
    }
    K--;
    cout<<2<<' '<<K;
    for(int i=1;i<=K;i++) cout<<' '<<a[i];
    cout<<'\n';
    cout.flush();
    return 0;
}