while True:
try:
n = int(input())
start, right, down, m = 1, 2, 1, n
for i in range(n):
num, step = start, right
for _ in range(m):
print(num, end=' ')
num += step
step += 1
print()
m -= 1
start += down
down += 1
right += 1
except:
break