N = int(input())

L = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"]

ans = []
def f(List, n):
    if n == N:
        s = ""
        for l in List:
            s += L[l]
        ans.append(s)
        return None
    for i in range(List[-1]+2):
        f(List+[i], n+1)

f([0], 1)        
ans.sort()
for a in ans:
    print(a)