#include #include #include #include using namespace std; int n; string rest; char buf[3000]; int cmp(const void *p, const void *q){ int a = *static_cast(p); int b = *static_cast(q); printf("? %d %d%s", a, b, rest.c_str()); fflush(stdout); fgets(buf, 3000, stdin); if(buf[0] == '<'){ return -1; } if(buf[0] == '>'){ return 1; } return 0; } int main(){ scanf("%d%*c", &n); for(int i = 1; i < n; ++i){ rest += " 0 0"; } rest += '\n'; vector v(n); for(int i = 0; i < n; ++i){ v[i] = i + 1; } qsort(&v[0], n, sizeof(int), cmp); putchar('!'); for(int i = 0; i < n; ++i){ printf(" %d", v[i]); } puts(""); }