n = int(input())
line_num = 1
# j控制 行的循环次数
for j in range(1, n+1):
# line_num代表每一行的第一个数字
num = line_num
# i控制列的循环次数
for i in range(j, n+1):
print(num, end=' ')
num = num + i +1
print()
line_num = line_num + j
line_num = 1
# j控制 行的循环次数
for j in range(1, n+1):
# line_num代表每一行的第一个数字
num = line_num
# i控制列的循环次数
for i in range(j, n+1):
print(num, end=' ')
num = num + i +1
print()
line_num = line_num + j