N = int(input())
W = 'abcdefghij'
ans = set()

for i in range(1,N+1):
  if i == 1:
    ans.add('a')
  else:
    tmp = set()
    for a in ans:
      index = W.index(sorted(list(a))[-1])
      for i in range(index+2):
        tmp.add(a+W[i])
    ans = tmp
    
for a in ans:
  print(a)