A = ["a","b","c","d","e","f","g","h","i","j"]
n = int(input())
l = ["a"]

def L(n):
  if n == 1:
    return l
  else:
    m = len(L(n-1))
    N = []
    for i in range(m):
      M = []
      k = len(set(L(n-1)[i]))
      for j in range(k+1):
        M = M.append(L(n-1)[i]+A[j]) 
      N += M
    return N

for _ in range(len(L(n))):
  print(L(n)[_])