while True:
    try:
        a = int(input())
        res = []
        
        for i in range(a):
            if i == 0:
                res = [(j+2)*(j+1)//2 for j in range(a)]
            else:
                res = [z-1 for z in res[1:]]
            print(' '.join(map(str,res)))               
    except:
        break