n = int(input())
al_list = ["a","b","c","d","e","f","g","h","i","j","k","l"]
def dfs(s,final,al_list):
  if len(s) == n:
    print(s)
  else:
    for hoge in range(al_list.index(final) + 2):
      tmp = s
      final = al_list[hoge]
      tmp += final
      dfs(tmp,final,al_list)
dfs("a","a",al_list)
      