import sys
input=lambda: sys.stdin.readline().rstrip()
n=int(input())
C=[1]*n
Ans=[C]
cur=n-1
while cur:
  cur=0
  for i in range(n-1):
    if C[i+1]<i+2:
      cur=i+1
  D=[]
  for i in range(n):
    if i<cur:
      D.append(C[i])
    elif i==cur:
      D.append(C[i]+1)
    else:
      D.append(1) 
  if cur!=0:
    Ans.append(D)
  C=Ans[-1]
for a in Ans:
  ans=""
  for i in range(n):
    ans+=chr(a[i]+96)
  print(ans)
