
N = int(input())

def n(s):
    tail = s[-1]
    tails = [chr(i) for i in range(ord('a'), ord(tail)+2)]
    return [s + t for t in tails]

def nn(li):
    r = []
    for l in li:
        r += n(l)
    return r
  
li = ['a']
for i in range(N-1):
    li = nn(li)
for i in li:
    print(i)