N=int(input()) p=[1]+[N-n for n in range(N-1)] for i in range(N): print(*p) p=p[-2:]+p[:-2]