n,m = map(int, input().split()) k = 1 for i in range(n): for j in range(m): if j == m-1: print(“PUM”) else: print(k , end=’ ‘) k += 1