n = input().split() r = int(n[0]) c = int(n[1]) a = 0 for i in range (r): for j in range (c): a += 1 if j == c - 1: print ("PUM") else: print (a, end=" ")