N = int(input())

alphabets = 'abcdefghijklmnopqrstuvwxyz'

def dfs(s, max_idx):
  if len(s) == N:
    print(s)
    return
  else:
    for i in range(0, max_idx+1):
      t = s
      t = t + alphabets[i]
      dfs(t, max(i, max_idx+1))
    
dfs("a", 1)