def dfs(n):
    adj = [chr(i+97) for i in range(26)]
    
    stack = ['a']
    combs = []
    while stack:
        node = stack.pop(0)
        if len(node) == n:
            combs.append(node)
        else:
            limit = ord(node[-1])%97 +2
            for child in adj[:limit]:
                cand = node+child
                stack.append(node+child)
    return combs

def main():
    import sys
    def input(): return sys.stdin.readline().rstrip()
    n = int(input())
    res = dfs(n)
    for ans in res:
        print(ans)


if __name__ == '__main__':
    main()