from collections import defaultdict
n=int(input())

al=[chr(ord('a') + i) for i in range(26)]

l=[0]*n

def judge(a,b):
  n=len(a)
  for i in  range(n-1):
    for j in range(i+1,n):
      if (a[i]==a[j] and b[i]==b[j]) or (a[i]!=a[j] and b[i]!=b[j]):
        pass
      else:
        return False
  return True

prev=defaultdict(list)
prev[1]=al
prev[2]=['aa','ab']
if n==1:
  print('a')
elif n==2:
  print('aa')
  print('ab')
        
else:
  for i in range(2,6):  # range(2,10)とすべきだが間に合わない
    for s in al:
      for char in prev[i]:
        new_s=char+s
        check=0
        for char2 in prev[i+1]:
          if check==1:
            break
          if judge(new_s,char2):
            check=1
            l=sorted([new_s,char2])
            if l[0] in prev[i+1]:
              pass
            else:
              prev[i+1].append(l[0])
              prev[i+1].remove(l[1])
        if check==0:
          prev[i+1].append(new_s)
  l=sorted(prev[n])
  for i in range(len(l)):
    print(l[i])
            