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

    for i in range(1, N):
        ns = []
        for j, s in enumerate(past):
            if j + 1 < i:
                for k in range(j + 2):
                    ns.append(s + abc[k])
            else:
                for k in range(i + 1):
                    ns.append(s + abc[k])
        past = ns
        for s in past:
            print(s)


if __name__ == '__main__':
    main()
