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