
n = int(input())
ans = []
data = ["a"] * n

def print_str(ans, data, i):
    if i == n:
        return
    for j in range(i + 1):
        data[i] = chr(ord(data[i]) + j)
        ans.append("".join(data))
        print_str(ans, data, i + 1)
        data[i] = "a"

print_str(ans, data, 0)
ans = sorted(set(ans))
for i in range(len(ans)):
    print(ans[i])