# x = int(input())
#
# data = []
#
# for i in range(x):
#
# dt = []
#
# dt.append(int(input()))
#
# data.append(dt)
#print(data)
# for i in range(x):
#
# for j in range(1,i+1):
#
# data[i].append(data[i][j-1]-data[i-1][j-1])
#
# for i in range(x):
#
# for j in range(0,i+1):
#
# print(data[i][j],end=" ")
#
# print()
# x = int(input())
# data = []
# sum = 1
# fk = 0
#
# for i in range(x):
# da = []
#
# for j in range(0,x):
# da.append(sum)
# sum = sum + 1
# data.append(da)
#
# for i in range(0,x):
# for j in range(0,x):
# #fk = fk + data[0][j] + data[x-1][j] + data[i][0] + data[i][x-1]
# if i==0 or i == x-1 or j == 0 or j == x-1:
# fk = fk + data[i][j]
#
# print(fk)
x, y = input().split()
x = int(x)
y = int(y)
data = []
for i in range(0,x):
fk = []
for j in range(0,y):
print(i, j)
if i == 0 or j == 0:
fk.append(1)
#data.append(fk)
else:
fk.append(data[i-1][j]+fk[j-1])
data.append(fk)
print(data)
print(data[x-1][y-1])