#include using namespace std; void output(const vector &v) { cout << "!"; for (int x: v) cout << " " << x+1; cout << endl; cout.flush(); } vector query(const vector &v, int n) { cout << "?"; for (int x: v) cout << " " << x + 1; cout << endl; cout.flush(); vector s(n); for (int i = 0; i < n; i++) { cin >> s[i]; } return s; } vector make(const set &lo, const set &hi, int n) { vector cand; vector vis(n); for (int x: lo) { if (!vis[x]) { vis[x] = 1; cand.push_back(x); } } if (cand.size() % 2) cand.push_back(-1); for (int x: hi) { if (!vis[x]) { vis[x] = 1; cand.push_back(x); } } while (cand.size() < 2 * n) cand.push_back(-1); return cand; } set cross(const set &a, const set &b) { set c; for (int x: a) { if (b.count(x)) c.insert(x); } return c; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n; cin >> n; vector fixed(n); vector ret(n); int s = 0, t = n-1; while (s <= t) { set lo, hi; for (int i = 0; i < n; i++) { if (!fixed[i]) { lo.insert(i); hi.insert(i); } } while (lo.size() > 1 || hi.size() > 1) { vector cand = make(lo, hi, n); vector ans = query(cand, n); set lo_t, hi_t; for (int i = 0; i < ans.size(); i++) { if (ans[i] == '<') { if (cand[2*i] == -1 && cand[2*i+1] == -1) {} else if (cand[2*i+1] == -1) { lo_t.insert(cand[2*i]); hi_t.insert(cand[2*i]); } else { lo_t.insert(cand[2*i]); hi_t.insert(cand[2*i+1]); } } else if (ans[i] == '>') { if (cand[2*i] == -1 && cand[2*i+1] == -1) {} else if (cand[2*i+1] == -1) { lo_t.insert(cand[2*i]); hi_t.insert(cand[2*i]); } else { lo_t.insert(cand[2*i+1]); hi_t.insert(cand[2*i]); } } } hi = cross(hi, hi_t); lo = cross(lo, lo_t); } ret[s++] = *lo.begin(); ret[t--] = *hi.begin(); fixed[*lo.begin()] = 1; fixed[*hi.begin()] = 1; } output(ret); return 0; }