while True:
    try:
        n = int(input())
        res = []
        
        for j in range(n):
            if j == 0:#写入第0行
                for i in range(n):
                    res.append(int((i+1)*(i+2)/2))
            else:#其余的行
                res = [z - 1 for z in res[1:]]
            print(' '.join(map(str,res)))            
       
    except:
        break