import sys
#input = sys.stdin.buffer.readline

def main():
    N = int(input())

    use = ["a"]
    if N == 1:
        print("a")
        exit()
    for i in range(1,N):
        ans = []
        for st in use:
            for j in range(ord(st[-1])-ord("a")+2):
                s = chr(97+j)
                if i == N-1:
                    print(st+s)
                else:
                    ans.append(st+s)
        use = ans
   
if __name__ == "__main__":
    main()
