while True:
try:
num = int(input()) #输入num
a = []
for i in range(num):
a.append([0]*num) #先创建一个num*num的二维列表
for i in range(num):
for j in range(num - i): #遍历整个上三角矩阵
if(j == 0):
if(i == 0):
a[i][j] = 1 #a[0][0] = 1
else:
a[i][j] = a[i-1][j] + i #第一列的值为上一行的值加上行数
else:
a[i][j] = a[i][j - 1] + i + j + 1 #不是第一列的值为本行的上一列加上本行数(指的是在矩阵中存储的行数(i))加本列数(j) + 1
for i in range(num):
for j in range(num - i):
print(a[i][j],end = ' ') #输出上三角矩阵
print('\r') #每输出一行回车
except:
break