n = int(input())
def dfs(s):
  if len(s) == n:
    print(s)
  else:
    final = ord(s[-1])
    for i in range(ord("a"),final+2):
      s = s + chr(i)
      dfs(s)
      s = s[:len(s) - 1]
      
dfs("a")