n=int(input())
from collections import deque
d=deque()
e=deque()
d.append("a")

alpha=list("abcdefghijklmnopqrstuvwxyz")
dic={alpha[i]:i for i in range(26)}
for i in range(n-1):
    while d:
        x=d.popleft()
 
        for j in range(dic[(x[-1])]+2):
            e.append(x+alpha[int(j)])  
    d=e
    e=deque()
d=list(d)

if n==1:
    print("a")
else:
    for some in d:
        print(some)
