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