n=int(input()) m=2*n-1 ans=[[0]*n for i in range(m)] for j in range(n): if j==n-1: for i in range(m): ans[i][j]=m continue if j%2: for i in range(j+1): ans[i][j]=j+1 for i in range(j+1,m): ans[i][j]=m-j-1 else: for i in range(m-j-1): ans[i][j]=m-j-1 for i in range(m-j-1,m): ans[i][j]=j+1 for i in ans: print(*i)