#include #include #include #include //#include #include #include #include #include #include //#include #include #include #include //#include #include #include //#include #include #include #include #include const int dx[] = {1, 0, -1, 0}; const int dy[] = {0, 1, 0, -1}; using namespace std; typedef long long ll; typedef vector vi; typedef vector vll; typedef pair pii; bool cmp[505][505]; int C[505]; bool comp(int a, int b) {return cmp[a][b];} int main() { int N; cin >> N; for (int i = 1; i <= N; i++) for (int j = i+1; j <= N; j++) { cout << "? " << i << " " << j << endl; cout.flush(); char c; cin >> c; if (c == '<') cmp[i][j] = true; else if (c == '>') cmp[j][i] = true; } for (int i = 0; i < N; i++) C[i] = i+1; sort(C, C+N, comp); cout << "! "; for (int i = 0; i < N; i++) { cout << C[i]; if (i < N-1) cout << " "; } cout << endl; cout.flush(); return 0; }