n, m = map(int, input().split())
a = [[0] * m] * n
print(a)

a[0][0] = 1
print(a)