#include using namespace std; signed main(){ int v, d; cin >> v >> d; vector> G(v, vector(v, false)); if(d==1)G=vector>(v,vector(v,true)); else{ for (int i = 1; i < v; i += 2){ G[i][0] = G[0][i] = true; G[i + 1][0] = G[0][i + 1] = true; G[i][i + 1] = G[i + 1][i] = true; } if(v%2==0){ G[v - 1][0] = G[0][v - 1] = true; G[v - 1][v - 2] = G[v - 2][v - 1] = true; } } for(auto g:G){ for(auto i:g) cout << i; cout << endl; } }