n=int(input()) a=[i//2+1 if i%2==0 else i//2+2+n//2 for i in range(n)] for i in range(n): print(a) a=a[1:]+[a[0]]