#yuki1399 v,d=map(int,input().split()) if d>1: print('1'*v) for i in range(v-1): print('1'+'0'*(v-1)) else: for i in range(v): print('1'*v)