#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll N=2e5+10;
ll n, ans[N];
bool ask(ll x, ll y) {
ll r;
printf("2 %lld %lld", x, y);
fflush(stdout);
scanf("%lld", &r);
return (r==x);
}
struct r {
ll id;
bool operator <(const r &s) const
{ return ask(s.id, id); }
};
priority_queue<r> q;
int main() {
scanf("%lld", &n);
for(ll i=1; i<=n; i++) q.push({i});
for(ll i=1; i<=n; i++) {
auto t = q.top();
ans[i] = t.id;
q.pop();
}
printf("3 ");
for(ll i=1; i<=n; i++) printf("%lld ", ans[i]);
fflush(stdout);
return 0;
}
自己造数据都过了,但是0分。