N=int(input()) for n in range(N): tmp=[] for k in range(N): tmp.append((n*2-k)%N+1) print(*tmp)