matrix = []
import random
m,n = int(input()),int(input())
for i in range(m):
for j in range(n):
print(i,j)
matrix[i][j] = random.randint(1,9)
print()
print(matrix)
matrix = [[0 for x in range(n)] for y in range(m)]
matrix = []
for i in range(m):
matrix.append([])
for j in range(n):
matrix[i].append(random.randint(1,9))