n=int(input())

al=['a','b','c','d','e','f','g','h','i','j']

ans=[]

st='a'

temp=0
now=0

def dfs(st,n,now,temp):
  if now==n-1:
    ans.append(st)
  else:
    dfs(st+al[temp],n,now+1,temp)
    dfs(st+al[temp+1],n,now+1,temp+1)
    
dfs(st,n,0,0)

for h in ans:
  print(h)
      