def dfs(base, dic, swap, ma):
    if len(base) == ma:
        print(base)
    else:
        num = swap[base[-1]] + 1
        for i in range(num + 1):
            dfs(base + dic[i], dic, swap, ma)


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",
       }
swap = {v: k for k, v in dic.items()}
dfs("a", dic, swap, n)
