#include #include #include using namespace std; using namespace atcoder; using mint = modint998244353; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf32 1000000001 #define Inf64 1000000000000000000LL int query(int i,int j){ cout<<1<<' '<>res; return res; } int main(){ int N; cin>>N; scc_graph G(N); vector> E(N); rep(i,N){ int res = query(i+1,i+1); if(res!=-1){ G.add_edge(i,res-1); E[i].push_back(res-1); } } auto s = G.scc(); vector pos(N); rep(i,N)pos[s[i][0]] = i; vector dp(N,1); for(int i=N-1;i>=0;i--){ int ma = 0; int v = s[i][0]; rep(j,E[v].size()){ int u = E[v][j]; ma = max(ma,dp[pos[u]]); } dp[i] = ma+1; } int ii = 0; rep(i,N){ if(dp[i]>dp[ii])ii = i; } int v = s[ii][0]; rep(i,N){ if(v==i)continue; int res = query(v+1,i+1); if(res!=-1){ G.add_edge(v,res-1); G.add_edge(i,res-1); } G.add_edge(v,i); } s = G.scc(); vector ans(N); rep(i,N)ans[s[i][0]] = i; cout<<2; rep(i,N){ cout<<' '<