def func(x):
    result = [ [0 for j in range(x-i)] for i in range(x)]
    for i in range(len(result)):
        result[i][0] = int(i * (i+1) / 2 + 1)
        for j in range(1,len(result[i])):
            result[i][j] = int(result[i][j-1] + i + j + 1)
    return result

while True:
    try:
        a = int(input())
        b = func(a)
        for i in range(len(b)):
            print(*b[i])
    except:
        break