N = int(input())
mojis = ["a","b","c","d","e","f","g","h","i","j"]
def append_m(moji):
    arr = []
    for i in mojis[:len(set(moji))+1]:
        arr.append(moji+i)
    return arr
arr = ["a"]
for i in range(N-1):
    tmp = []
    for j in arr:
        tmp += append_m(j)
    arr = tmp
for i in arr:
    print(i)