def solve():
    N = int(raw_input())
    ret = [('a', 'a')]
    for i in range (2, N+1):
        tmp = []
        for stri in ret:
            for j in range(ord('a'), ord(stri[1]) + 1):
                tmp.append((stri[0] + chr(j), stri[1]))
            tmp.append((stri[0] + chr(ord(stri[1]) + 1), chr(ord(stri[1]) + 1)))
        ret = tmp
    for stri in ret:
        print stri[0]

if __name__ == '__main__':
    solve()
