K=int(input()) X=[[] for _ in range(K)] for i in range(1,pow(2,K)): b=i&(-i) j=b.bit_length()-1 X[j].append(i) P=[] for x in X[::-1]: P+=x del P[P.index(1)] P=[1]+P print(*P)