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 s in past:
            for j in range(i + 1):
                ns.append(s + abc[j])
        past = ns
        for s in past:
            print(s)


if __name__ == '__main__':
    main()
