V,D=map(int,input().split()) for i in range(V): S=str() for j in range(V): if i==0: S+="1" else: if j==0: S+="1" else: S+="0" print(S)