N = int(input())
chl = "abcdefghijk"
chli = {
  'a':0,
  'b':1,
  'c':2,
  'd':3,
  'e':4,
  'f':5,
  'g':6,
  'h':7,
  'i':8,
  'j':9
}

def ret(M):
  if M == 1:
    return "a"
  retl = []
  for stra in ret(M-1):
    maxi = min(chli[stra[-1]] + 2, 10)
    cand = chl[:maxi]
    for ch in cand:
      retl.append(stra + ch)
  return retl

ans = ret(N)

for x in ans:
  print(x)
