n=int(input())
a=1
S=[1]*n
for x in range(n):
  print(chr(S[x]+96),end="")
print()
j=1
i=1
while i<n:
  if S[-i]>S[-i-1]:
    i=i+1
  else:
    S[-i]+=1
    if i<=j:
      for x in range(n):
        print(chr(S[x]+96),end="")
      print()
      if S==[i for i in range(1,n+1)]:
        exit()
    else:
      j=i
      for k in range(1,i):
        S[-k]=1
      i=1
      j=1
      for x in range(n):
        print(chr(S[x]+96),end="")
      print()