n=int(input())
ans=[[] for _ in range(10) ]
for i in range(10):
  ans[i]=["" for _ in range(int(2**i))]
ans[0]=["a"]
ans[1]=["aa","ab"]
abc=["a","b","c","d","e","f","g","h","i","j"]
if n>2:
  for i in range(2,n):
    str=ans[i-1]
    ii=0
    for x in str:
      jj=abc.index(x[-1])
      ans[i][ii]=x+"a"
      ans[i][ii+1]=x+abc[jj+1]
      ii+=2
#print(len(ans[n-1]))

for x in ans[n-1]:
    print(x)
