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

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