N = int(input())
count = 1
# 使用列表生成式创建二维列表
ans = [[] for _ in range(N)]
# 把元素添加进来
for i in range(N):
    for j in range(i+1):
        ans[i-j].append(count)
        count += 1
# print
for i in range(N):
    for num in ans[i]:
        print(num, end=" ")
    print()