l = ['a','b','c','d','e','f','g','h','i','j']
N = int(input())


if N == 1:
    print('a')
elif N == 2:
    print('aa')
    print('ab')
else:
    DONELIST = ['aa']
    PROCESSLIST = ['ab']
    PROCESSLIST2 = []
    for i in range(1, N-1):
        for j in range(len(DONELIST)):
            DONELIST[j] = 'a' + DONELIST[j]
        for j in range(len(PROCESSLIST)):
            DONELIST.append('a' + PROCESSLIST[j])
            for k in range(i+1):
                PROCESSLIST2.append(PROCESSLIST[j] + chr(97+k))

        PROCESSLIST2.append(PROCESSLIST[-1] + chr(97+len(PROCESSLIST[-1])))
        PROCESSLIST = PROCESSLIST2
        PROCESSLIST2 = []

    for w in DONELIST:
        print(w)
    for w in PROCESSLIST:
        print(w)
