n=int(input())
s="abcdefghij"
end=[0,1,2,3,4,5,6,7,8,9]
lim=0
res=[0]*n
for i in res:
  print(s[i],end="")
print("")

while res!=end[:n]:
  res[(n-1)]=res[(n-1)]+1
  for i in range(n-1):
    if res[n-i-1]>(res[n-i-2]+1):
      res[n-i-1]=0
      res[n-i-2]=res[n-i-2]+1
  for i in res:
    print(s[i],end="")
  print("")