// Subtasks:
// _: AC

#include <iostream>
#include <random>
#include <vector>

using namespace std;
using ll = long long;

mt19937 g(67);

const int N = 505;
bool adj[N][N];

bool query(int a, int b) {
    cout << "? " << a+1 << ' ' << b+1 << endl;
    char c;
    cin >> c;
    return c == '>';
}

void answer(vector<int> v) {
    cout << "! ";
    for (int i : v) cout << i+1 << ' ';
    cout << endl;
}

int main() {
    cin.tie(0) -> sync_with_stdio(0);

    int n, t;
    cin >> n >> t;

    if (n < 40) {
        for (int i = 0; i < n; ++i) {
            for (int j = 1; j <= n/2; ++j) {
                int k = (i+j) % n;
                adj[i][k] = 1;
                adj[k][i] = 0;
            }
        }
    } else {
        for (int i = 0; i < n; ++i) {
            for (int j = 1; j <= n/2; ++j) {
                int k = (i+j) % n;
                adj[i][k] = g() % 2;
                adj[k][i] = adj[i][k] ^ 1;
            }
        }
    }
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < n; ++j) {
            cout << adj[i][j];
        }
        cout << endl;
    }

    for (int ti = 0; ti < t; ++ti) {
        vector<int> v = {0};
        for (int i = 1; i < n; ++i) {
            for (int j = 0; j < (int) v.size(); ++j) {
                if (query(i, v[j])) {
                    v.insert(v.begin()+j, i);
                    break;
                }
            }
            if ((int) v.size() == i) v.push_back(i);
        }
        int j = 0;
        while (!query(v.back(), v[j])) ++j;
        while (j > 0) {
            if (query(v.back(), v[j-1])) --j;
            else {
                v.insert(v.begin()+j, v.back());
                v.pop_back();
            }
        }

        answer(v);
    }

    return 0;
}
