def main():
    N = int(input())
    abc = ('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j')
    past = [[0, 'a']]

    for i in range(1, N):
        ns = []
        for s in past:
            for j in range(s[0] + 2):
                ns.append([j, s[1] + abc[j]])
        past = ns
        if i == N - 1:
            for s in sorted(past):
                print(s[1])


if __name__ == '__main__':
    main()
