import sys
input = sys.stdin.readline

def main():

    S = ["a"]
    N = int(input())

    def add_str(S):
        if len(S)==N:
            print("".join(S))
        else:
            for j in range(97,ord(S[-1])+2):
                add_str(S+[chr(j)])

    add_str(S)

if __name__ == '__main__':
    main()