# n=int(input())
# arr=[]
# for i in range(n):
# a=[0]*n
# arr.append(a)
#
# k=1
# # range(n) : 0 ~ n-1 -> n-1 ~0 range(n-1,-1,-1)
# for i in range(n) :
# for j in range(n-1,-1,-1) :
# arr[i][j]=k
# k+=1
#
# for i in range(n) :
# for j in range(n) :
# print(arr[i][j],end=' ')
# print()
# n=int(input())
# arr=[]
# for i in range(n):
# a=[0]*n
# arr.append(a)
#
# k=1
# for j in range(n) :
# for i in range(n) :
# arr[i][j]=k
# k+=1
#
# for i in range(n) :
# for j in range(n) :
# print(arr[i][j],end=' ')
# print()
# n=int(input())
# arr=[]
# for i in range(n):
# a=[0]*n
# arr.append(a)
#
# k=1
# for j in range(n) :
# for i in range(n-1,-1,-1) :
# arr[i][j]=k
# k+=1
#
# for i in range(n) :
# for j in range(n) :
# print(arr[i][j],end=' ')
# print()
n,m=map(int,input().split())
arr=[]
for i in range(n):
a=m*[0]
arr.append(a)
k=1
for i in range(n-1,-1,-1) :
for j in range(m-1,-1,-1) :
arr[i][j]=k
k+=1
for i in range(n) :
for j in range(m) :
print(arr[i][j],end=' ')
print()



