import math,itertools,fractions,heapq,collections,bisect,sys,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

l=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']

def main():
  n=I()

  ans='a'*n
  print(ans)
  x=1
  while True:
    a=l[x]
    f=True
    if x>n:
      break
    _ans=ans
    for k in range(n-x):
      for i in range(x+k,len(ans))[::-1]:
        print(_ans[:i]+a+_ans[i+1:])
      _ans=_ans[:k+1]+a+_ans[k+2:]

    ans=ans[:x]+a+ans[x+1:]
    x+=1

main()
# print(main())
