#include #include using namespace std; int main(void) { int a[500]; bool b[500][500] = {0}; int c[500] = {0}; int buf[500]; int n; cin >> n; for(int i = 0; i < n; i++) a[i] = i + 1; int offset = 0; int count = 0; int nn = n * (n - 1) / 2; while(count < nn) { bool t[500] = {0}; string str = "?"; int sc = 0; for(int i = 0; i < n; i++) { int j = (i + offset + 1) % n; if(t[i] || t[j] || b[i][j] || b[j][i]) continue; str += " " + to_string(i + 1) + " " + to_string(j + 1); buf[sc * 2] = i; buf[sc * 2 + 1] = j; count++; sc++; t[i] = t[j] = b[i][j] = b[j][i] = true; } offset = (offset + 1) % (n - 1); if(sc == 0) continue; for(int i = sc; i < n; i++) str += " 0 0"; //continue; cout << str << endl; cout.flush(); string s; cin >> s; for(int i = 0; i < sc; i++) { if(s[i * 2] == '<') c[buf[i * 2 + 1]]++; else c[buf[i * 2]]++; } } string res = "!"; for(int i = 0; i < n; i++) { int m = c[i]; int k = i; for(int j = i + 1; j < n; j++) { if(c[j] < m) { m = c[j]; k = j; } } res += " " + to_string(a[k]); swap(c[i], c[k]); swap(a[i], a[k]); } cout << res << endl; cout.flush(); return 0; }