alpha_small_ = [chr(i) for i in range(97, 97+26)] #アルファベッドの小文字
alpha_small_dict = {chr(i):i-97 for i in range(97, 97+26)} #辞書ver

n = int(input())
data = [[] for _ in range(n)]
data[0] = ["a"]
for i in range(1,n):
    for x in data[i-1]:
        for j in alpha_small_[:i+1]:
            data[i].append(x+j)

for x in data[n-1]:
    print(x)