n = int(input())
alpha = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"]
def doukei(n):
  if n == 1:
    return ["a"]
  k = doukei(n-1)
  ans = []
  for i in range(len(k)):
    key = k[i][-1]
    ans.append(k[i]+"a")
    for j in range(1, 10):
      ans.append(k[i]+alpha[j])
      if key == alpha[j-1]:
        break
  return ans
answer = doukei(n)
for i in range(len(answer)):
  print(answer[i])