n=int(input())
m=n
a=["a","b","c","d","e","f","g","h","i"]
for i in range(97,97+n+1):
  ans_l=a[:n-m]
  if m>1:
    for j in range(2**(m-1)-1):
      ans=[chr(i)]*m
      for k in range(m):
        if (j>>k)&1:
          ans[m-1-k]=chr(i+1)
      print("".join(ans_l+ans))
  elif m==1:
    print("".join(ans_l+[chr(i)]))
  m-=1