// Subtasks:
// 1: AC
// 2: AC
// 3: AC
// 4: WA

// phase 1: ring
// phase 2: partition into two, merge sort

#include <iostream>
#include <vector>

using namespace std;

bool ask(int u, int v) {
    cout << "? " << u << " " << v << " ";
    char ans;
    cin >> ans;
    return ans == '>';
}

int arr[501];

void mergesort(int b, int e) {
    if (e-b <= 1) return;
    int mid = (b+e)/2;
    mergesort(b, mid);
    mergesort(mid, e);

    vector<int> res;
    int l = b, r = mid;
    while (l < mid && r < e) {
        if (ask(arr[l], arr[r])) {
            res.push_back(arr[l++]);
        } else {
            res.push_back(arr[r++]);
        }
    }
    while (l < mid) res.push_back(arr[l++]);
    while (r < e) res.push_back(arr[r++]);

    for (int i = 0; i < e-b; ++i) {
        arr[b + i] = res[i];
    }
}

void hybrid_sort(int b, int e) {
    if (e-b <= 1) return;
    int pivot = arr[b];
    vector<int> l, r;
    for (int i = b+1; i < e; ++i) {
        if (ask(pivot, arr[i])) r.push_back(arr[i]);
        else l.push_back(arr[i]);
    }
    int i = b;
    for (int x : l) arr[i++] = x;
    int mid = i;
    arr[i++] = pivot;
    for (int x : r) arr[i++] = x;
    mergesort(b, mid);
    mergesort(mid+1, e);
}

int main() {
    int n, t;
    cin >> n >> t;

    for (int i = 1; i <= n; ++i) {
        for (int j = 1; j <= n; ++j) {
            if (i != j && (j > i) != (abs(j-i) <= n/2)) cout << 1;
            else cout << 0;
        }
        cout << endl;
    }

    for (int ti = 0; ti < t; ++ti) {
        for (int i = 1; i <= n; ++i) arr[i] = i;
        hybrid_sort(1, n+1);

        cout << "! ";
        for (int i = 1; i <= n; ++i) {
            cout << arr[i];
            if (i != n) cout << " ";
        }
    }
}
