chars = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"]
N = int(input())

def solve(s = "", depth = 0):
  if len(s) == N:
    print(s)
    return
  
  for i in range(depth + 1):
    solve(s + chars[i], depth + 1)

solve()
