import random; k=int(input()); if k==2: print(1,3,2) else: ans=list(range(2**k-1)) random.shuffle(ans) print(" ".join(map(str,ans)))