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

if __name__ == '__main__':
    solve()
