from collections import deque
n = int(input())
l = ["a","b","c","d","e","f","g","h","i","j","k"]
ansl = []
for i in range(n):
    d = deque()
    ans = ""
    for i in range(n-i):
        ans += l[0]
    if len(ans) == n:
        ansl.append(ans)
    d.append([ans,0])
    while len(d):
        now,m = d.pop()
        if len(now) == n:
            if m > 0:
                ansl.append(now)
        else:
            d.append([now+l[m],m])
            d.append([now+l[m+1],m+1])
ansl.sort()
for i in ansl:
    print(i)