n = int(input().strip())
dic = {0: "a",
       1: "b",
       2: "c",
       3: "d",
       4: "e",
       5: "f",
       6: "g",
       7: "h",
       8: "i",
       9: "j",
       }

prev = [""]
for i in range(n):
    curr = []
    for elem in prev:
        for j in range(0, i + 1):
            curr.append(elem + dic[j])
    prev = curr
for e in prev:
    print(e)
