#include "bits/stdc++.h" using namespace std; #ifdef _DEBUG #include "dump.hpp" #else #define dump(...) #endif //#define int long long #define rep(i,a,b) for(int i=(a);i<(b);i++) #define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--) #define all(c) begin(c),end(c) const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f; const int MOD = 1'000'000'007; template bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; } template bool chmin(T &a, const T &b) { if (b < a) { a = b; return true; } return false; } using Weight = int; struct Edge { int s, d; Weight w; Edge() {}; Edge(int s, int d, Weight w) : s(s), d(d), w(w) {}; }; bool operator<(const Edge &e1, const Edge &e2) { return e1.w < e2.w; } bool operator>(const Edge &e1, const Edge &e2) { return e2 < e1; } inline ostream &operator<<(ostream &os, const Edge &e) { return (os << '(' << e.s << ", " << e.d << ", " << e.w << ')'); } using Edges = vector; using Graph = vector; using Array = vector; using Matrix = vector; void addArc(Graph &g, int s, int d, Weight w = 1) { g[s].emplace_back(s, d, w); } void addEdge(Graph &g, int a, int b, Weight w = 1) { addArc(g, a, b, w); addArc(g, b, a, w); } vector topologicalSort(const Graph &g) { int n = g.size(), k = 0; vector ord(n), indeg(n); for (auto &es : g) for (auto &e : es) indeg[e.d]++; queue q; for (int i = 0; i < n; i++) if (indeg[i] == 0) q.push(i); while (q.size()) { int v = q.front(); q.pop(); ord[k++] = v; for (auto &e : g[v]) if (--indeg[e.d] == 0) q.push(e.d); } return *max_element(indeg.begin(), indeg.end()) == 0 ? ord : vector(); } signed main() { cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; Graph g(N); vector> d(N, vector(N)); rep(t, 0, 2000) { vector used(N); vector query; rep(i, 0, N) { rep(j, i + 1, N) { if (d[i][j] || used[i] || used[j])continue; used[i] = true; used[j] = true; query.emplace_back(i + 1); query.emplace_back(j + 1); d[i][j] = true; } } if (query.size() == 0) break; rep(i, query.size(), 2 * N) query.emplace_back(0); cout << "? "; cout << query[0]; rep(i, 1, query.size()) { cout << " " << query[i]; } cout << endl; vector r(N); rep(i, 0, N) { cin >> r[i]; } rep(i, 0, N) { int u = query[2 * i] - 1, v = query[2 * i + 1] - 1; if (r[i] == '>') { addArc(g, v, u); } else if (r[i] == '<') { addArc(g, u, v); } } } auto res = topologicalSort(g); cout << "! "; cout << res[0] + 1; rep(i, 1, res.size()) { cout << " " << res[i] + 1; } cout << endl; return 0; }