n = int(input())

ans = [[1]]

for i in range(n-1):
  new_ans = []
  new_ans += [
    [1] + i
    for i 
    in ans
  ]
  new_ans += [
    [1] + [j+1 for j in i]
    for i 
    in ans
  ]

  ans = new_ans


def num2str(num):
  d = {
    1: "a",
    2: "b",
    3: "c",
    4: "d",
    5: "e",
    6: "f",
    7: "g",
    8: "h",
    9: "i",
    10: "j"
  }
  return d[num]

for i in ans:
  print("".join([num2str(j) for j in i]))
