#include #define rep(i, a) rep2 (i, 0, a) #define rep2(i, a, b) for (int i = (a); i < (b); i++) #define repr(i, a) repr2 (i, 0, a) #define repr2(i, a, b) for (int i = (b) - 1; i >= (a); i--) #define chmin(a, b) ((b) < a && (a = (b), true)) #define chmax(a, b) (a < (b) && (a = (b), true)) #define rng(a) (a).begin(), (a).end() using namespace std; typedef long long ll; #include #define rep(i, a) rep2 (i, 0, a) #define rep2(i, a, b) for (int i = (a); i < (b); i++) #define repr(i, a) repr2 (i, 0, a) #define repr2(i, a, b) for (int i = (b) - 1; i >= (a); i--) #define chmin(a, b) ((b) < a && (a = (b), true)) #define chmax(a, b) (a < (b) && (a = (b), true)) #define rng(a) (a).begin(), (a).end() using namespace std; typedef long long ll; int n; int C[555][555]; int a[555]; int comp(int i, int j) { cout << "?"; cout << " " << a[i] + 1 << " " << a[j] + 1; rep (i, n - 1) cout << " 0 0"; cout << endl; char str[2]; scanf("%s", str); int res; if (str[0] == '<') res = -1; else if (str[1] == '=') res = 0; else res = 1; rep (i, n - 1) scanf("%s", str); return res; } int quicksort(int a[], int l, int r) { if (l < r) { int p = a[rand() % (r - l + 1) + l]; int i = l - 1; int j = r + 1; while (true) { while (comp(a[++i], p) < 0); while (comp(a[--j], p) > 0); if (i >= j) break; swap(a[i], a[j]); } quicksort(a, l, i - 1); quicksort(a, j + 1, r); } } int main() { cin >> n; rep (i, n) a[i] = i; rep (i, n) a[i] = rand() % 100; quicksort(a, 0, n - 1); cout << "!"; rep (i, n) cout << " " << a[i] + 1 << endl; return 0; }