n = int(input())

arr= ['a','b','c','d','e','f','g','h','i','j']

def f(x, s):
  if x == n:
    print(s)
    return
  for i in range(n):
    f(x+1, s+arr[i])
    if s+arr[i] == "".join(arr[:i+1]):
      break
f(0, "")