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