#include "interactive.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> guess(int N) {
int start = ask(1);
map <int, int> mp;
for (int i = 0; i < 7; i++) {
vector <int> x;
for (int j = 2; j <= N; j++) {
if ((j >> i) & 1) x.push_back(j);
}
if (x.empty()) continue;
vector <int> A = get_pairwise_xor(x);
x.push_back(1);
vector <int> B = get_pairwise_xor(x);
multiset <int> now;
for (auto x : B) now.insert(x);
for (auto x : A) now.erase(now.find(x));
map <int, bool> vis;
for (auto x : now) {
if (x == start) continue;
if (vis[x^start]) continue;
vis[x^start] = 1;
mp[x^start] += (1LL<<i);
}
}
vector <int> ans(N+5), ret;
ans[1] = start;
for (auto [val, pos] : mp) {
ans[pos] = val;
}
for (int i = 1; i <= N; i++) {
ret.push_back(ans[i]);
}
return ret;
}