import itertools
n = int(input())
alpha = ["a","b","c","d","e","f","g","h","i","j"]
selection = alpha[0:n]
my_list = [i for i in list(itertools.product(selection,repeat=n)) if i[0] == "a"]
my_list.sort()
for t in my_list:
    print("".join(t))

