i = int(input())
p = print
jlist = [None] * 10
def jjj(i):
    if jlist[i-1] is not None:
        return jlist[i-1]
    if i == 1:
        return ('a')
    # elif i== 2:
    #     return ('aa'), ('ab')
    # elif i==3:
    #     return ('aaa'), ('aab'), ('aba'), ('abb'), ('abc')
    elif i>=2:
        u = []
        # u = list(map(lambda x: 'a'+x), jjj(i-1))
        for k in range(2):
            u+= list(map(lambda x: 'a'+slide(x, k), jjj(i-1)))
        jlist[i-1] = u
        return u
        

def slide(s, k):
    ss = ''
    for c in s:
        cc = ord(c) + k
        ss += chr(cc)
    return ss

p('\n'.join(jjj(i)))
