N = int(input())
a = [[[0]]]
k = 0
while k < N-1:
  c = a[k]
  a.append([])
  for r in c:
    for i in range(r[-1]+2):
      x = r + [i]
      a[k+1].append(x)
  
  k += 1
A = a[-1]
for s in A:
  ans = ""
  for i in range(N):
    ans += chr(s[i]+97)
  print(ans)