import itertools
n=int(input())
s='abcdefghijklmnopqrstuvwxyz'
for l in itertools.combinations_with_replacement(range(1,n+1),n):
  c=1
  ans=''
  for i in l:
    if i>c:
      break
    elif i==c:
      c+=1
    ans+=s[i-1]
  if len(ans)==n:
    print(ans)