import sys readline=sys.stdin.readline N=int(readline()) inve2=(N+1)//2 ans_lst=[[(i+j)*inve2%N+1 for j in range(N)] for i in range(N)] for ans in ans_lst: print(*ans)