#include #include #include #include #include using namespace std; int n; char buf[3000]; vector > cmp; void cmp_swap(int lvl, int a, int b){ if(a < n && b < n){ while((int)cmp.size() <= lvl){ cmp.push_back(vector()); } cmp[lvl].push_back(a); cmp[lvl].push_back(b); } } int oe_merge(int lvl, int lo, int hi, int r){ int step = r * 2; if(step < hi - lo){ int t1 = oe_merge(lvl, lo, hi, step); int t2 = oe_merge(lvl, lo + r, hi, step); int t = max(t1, t2); for(int i = lo + r; i < hi - r; i += step){ cmp_swap(t, i, i + r); } return t + 1; } else{ cmp_swap(lvl, lo, lo + r); return lvl + 1; } } int oe_merge_sort_range(int lvl, int lo, int hi){ if(hi - lo >= 1){ int mid = lo + ((hi - lo) >> 1); int t1 = oe_merge_sort_range(lvl, lo, mid); int t2 = oe_merge_sort_range(lvl, mid + 1, hi); return oe_merge(max(t1, t2), lo, hi, 1); } return lvl; } int main(){ fgets(buf, 3000, stdin); n = strtol(buf, 0, 10); int m = 1; while(m < n){ m <<= 1; } oe_merge_sort_range(0, 0, m - 1); vector v(n); for(int i = 0; i < n; ++i){ v[i] = i + 1; } for(size_t i = 0; i < cmp.size(); ++i){ int len = cmp[i].size(); putchar('?'); for(int j = 0; j < 2 * n; ++j){ if(j < len){ printf(" %d", v[cmp[i][j]]); } else{ printf(" 0"); } } puts(""); fflush(stdout); fgets(buf, 3000, stdin); for(int j = 0; j < len; j += 2){ if(buf[j] == '>'){ swap(v[cmp[i][j]], v[cmp[i][j + 1]]); } } } for(int i=cmp.size();i<1999;++i){ putchar('?'); for(int j = 0; j < 2 * n; ++j){ printf(" 0"); } puts(""); fflush(stdout); } putchar('!'); for(int i = 0; i < n; ++i){ printf(" %d", v[i]); } puts(""); }