al=[chr(ord('a') + i) for i in range(26)]
N=int(input())
ans=[[] for _ in range(N)]
ans[0].append("a")

if N==1:
  print("a")
else:
  for i in range(1,N):    
    for item in ans[i-1]:
      for j in range(i+1):
        ans[i].append(item +chr(ord('a') + j))
  for answer in ans[-1]:
    print(answer)