n = int(input())
lst = []
abc = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"]
for i in range(n):
    lst_ = lst
    lst = []
    for s in lst_:
        for j in range(10):
            if s[-1] == abc[j - 1]:
                break
            else:
                lst.append(s + abc[j])
for s in lst:
    print(s)