K = int(input())
word_dic = {"a":1,"b":2,"c":3,"d":4,"e":5,"f":6,"g":7,"h":8,"i":9,"j":10}
l_word = ["a","b","c","d","e","f","g","h","i","j"]
L = ["a"]
if K == 1:
  print("a")
else:
  for i in range(K-1):
    M = []
    for x in L:
      k_x = word_dic[x[-1]]
      for j in range(k_x+1):
        M.append(x + l_word[j])
    L = M[:]
  else:
    for x in L:
      print(x)