#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include //#include using namespace std; vector v; int n; #define MAX 502 bool cm[MAX][MAX]; set s[MAX]; void output(vector > v){ printf("?"); for (int i = 0; i < v.size(); i++){ printf(" %d %d", v[i].first, v[i].second); } puts(""); fflush(stdout); fflush(stdin); char ss[3]; for (int i = 0; i < v.size(); i++){ scanf("%s", ss); if (ss[0] == '<'){ cm[v[i].first][v[i].second] = true; } s[v[i].first].erase(v[i].second); s[v[i].second].erase(v[i].first); } fflush(stdin); fflush(stdout); } bool cmp(int a, int b){ return cm[a][b]; } int main(){ scanf("%d", &n); for (int i = 1; i <= n; i++){ v.push_back(i); } int summ = 0; for (int i = 1; i <= n; i++){ for (int j = 1; j <= n; j++){ if (i == j){ continue; } s[i].insert(j); summ++; } } int countt = 0; while (countt < summ){ set used; used.clear(); vector > v; for (int i = 1; i <= n; i++){ if (used.count(i)){ continue; } set::iterator ite; for (ite = s[i].begin(); ite != s[i].end(); ite++){ if (used.count(*ite)){ } else{ v.push_back(make_pair(i,(*ite))); used.insert(i); used.insert((*ite)); break; } } } countt += v.size() * 2; output(v); } sort(v.begin(), v.end(), cmp); printf("!"); for (int i = 0; i < v.size(); i++){ printf(" %d", v[i]); } puts(""); fflush(stdout); fflush(stdin); return 0; }