V, D = map(int, input().split()) # Create a complete graph where each vertex is connected to all others except itself result = [] for i in range(V): row = ['1'] * V row[i] = '0' result.append(''.join(row)) for line in result: print(line)