from string import ascii_lowercase

def resolve():
    n = int(input())
    l = [[0]]
    for i in range(1, n):
        ll = []
        for j in l:
            for k in range(j[-1] + 2):
                ll.append(j + [k])
        l = ll
    for i in l:
        print("".join([ascii_lowercase[x] for x in i]))

if __name__ == '__main__':
    resolve()
