#include using namespace std; namespace { typedef double real; typedef long long ll; template ostream& operator<<(ostream& os, const vector& vs) { if (vs.empty()) return os << "[]"; os << "[" << vs[0]; for (int i = 1; i < vs.size(); i++) os << " " << vs[i]; return os << "]"; } template istream& operator>>(istream& is, vector& vs) { for (auto it = vs.begin(); it != vs.end(); it++) is >> *it; return is; } int N; void input() { cin >> N; } void solve() { vector> F(N, vector(N, -5)); queue> Q; vector> vs; for (int i = 0; i < N; i++) { for (int j = i + 1; j < N; j++) { vs.push_back(make_pair(i, j)); } } random_shuffle(vs.begin(), vs.end()); for (int i = 0; i < vs.size(); i++) Q.push(vs[i]); while (not Q.empty()) { cout << "?"; vector used(N, false); vector> V; set> S; for (int i = 0; V.size() < N && not Q.empty(); i++) { auto p = Q.front(); Q.pop(); int a = p.first; int b = p.second; if (S.count(p)) { Q.push(p); break; } S.insert(p); if (used[a] || used[b]) { Q.push(p); } else { cout << " " << a+1 << " " << b+1; used[a] = used[b] = true; V.push_back(p); } } for (int i = V.size(); i < N; i++) { cout << " 0 0"; } cout << endl; vector C(N, '?'); cin >> C; for (int i = 0; i < min(N, int(V.size())); i++) { int a = V[i].first; int b = V[i].second; if (C[i] == '>') { F[a][b] = 1; F[b][a] = -1; } else if (C[i] == '=') { F[a][b] = 0; F[b][a] = 0; } else { assert(C[i] == '<'); F[a][b] = -1; F[b][a] = 1; } } /* for (int i = 0; i < N; i++) { cout << F[i] << endl; } */ } vector> xs; for (int i = 0; i < N; i++) { int c = 0; for (int j = 0; j < N; j++) { c += (F[i][j] == 1); } xs.push_back(make_pair(c, i)); } sort(xs.begin(), xs.end()); cout << "!"; for (int i = 0; i < N; i++) { cout << " " << xs[i].second + 1; } cout << endl; } } int main() { input(); solve(); return 0; }