n = int(input())
l = ["a","b","c","d","e","f","g","h","i","j"]
i = 0
def st(s,n,k):
  if k == n:
    print(s)
    return
  ss = s[-1]
  for i,w in enumerate(l):
    if w == ss:
      j = i
  for i in range(j+2):
    st(s+l[i],n,k+1)
st("a",n,1)