N = int(input())
char = "abcdefghij"
prev = ["a"]
results = []
for i in range(N-1):
  results = []
  for p in prev:
    for j in range(i+2):
      results.append(p+char[j])
  prev = results
if N == 1:
  print("\n".join(prev))
else:
  print("\n".join(results))