alpha = "abcdefghijklmnopqrstuvwxyz"
ans = []
n = int(input())
def saiki(s):
    global ans
    if len(s) == n:
        ans.append(s)
    else:
        i = alpha.index(s[-1])
        for j in range(i+2):
            saiki(s+alpha[j])
saiki("a")
print("\n".join(ans))