#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#if defined(__has_include)&&__has_include("custom_h/debugging.h")
#define local_run 1
#include "custom_h\debugging.h"
#else
#define local_run 0
#endif
// #pragma GCC target ("avx2");
// #pragma GCC optimize ("Ofast");
#define rall(v) v.rbegin(),v.rend()
#define all(v) v.begin(),v.end()
#define keyval find_by_order
#define valkey order_of_key
#define int long long
#define pb push_back
#define s second
#define f first
using namespace __gnu_pbds;
using namespace std;
template<typename T>
using oset=tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
template<typename T>
using omset=tree<T,null_type,less_equal<T>,rb_tree_tag,tree_order_statistics_node_update>;
void set_io(string name=""){
ios_base::sync_with_stdio(0);cin.tie(0);
if(name.size() and !local_run){
freopen((name+".in").c_str(),"r",stdin);
freopen((name+".out").c_str(),"w",stdout);
}
}
const int my[]={0,0,1,-1,1,1,-1,-1};
const int mx[]={1,-1,0,0,1,-1,-1,1};
const int md=1e9+7;
const int oo=1e18;
vector<int>graph[5];
vector<bitset<5>>mat(5);
int n,q;
bool bfs(int s){
queue<pair<int,pair<bitset<5>,vector<int>>>>q;
bitset<5>aux;
vector<int>aux2;
q.push({s,{aux,aux2}});
while(!q.empty()){
int x=q.front().f;
bitset<60>v=q.front().s.f;
vector<int>p=q.front().s.s;
q.pop();
// cerr<<x<<" "<<p<<" "<<"\n";
v[x]=1;
p.pb(x);
if(graph[x].size()==1 and graph[x][0]==s and p.size()==n){
cout<<"! ";
for(int i:p)cout<<i<<" ";
cout<<endl;
return 1;
}
for(int i:graph[x]){
if(!v[i])q.push({i,{v,p}});
}
}
return 0;
}
void solve(){
cin>>n>>q;
for(int i=1;i<=n;i++){
for(int j=i+1;j<=n;j++){
if(i==1 and j==n)continue;
mat[i][j]=1;
}
}
mat[n][1]=1;
for(int i=1;i<=n;i++){
for(int j=1;j<=n;j++){
cout<<mat[i][j];
}
cout<<endl;
}
while(q--){
for(int i=1;i<=n;i++){
for(int j=i+1;j<=n;j++){
cout<<"? "<<i<<" "<<j<<endl;
char c;
cin>>c;
if(c=='<'){
graph[j].pb(i);
}else{
graph[i].pb(j);
}
}
}
// for(int i=1;i<=n;i++){
// cerr<<graph[i]<<"\n";
// }
for(int i=1;i<=n;i++){
if(bfs(i))break;
// cerr<<"\n";
}
}
}
int32_t main(){set_io("");
int t=1;
// cin>>t;
while(t--){
solve();
}
}