n=int(input()) a=[i for i in range(1,n+1)] for i in range(n-1,0,-1): a.append(i) cnt=0 for i in range(n-1,-1,-1): print(*a[i:len(a)-cnt]) cnt+=1