import itertools
n = int(input())
original_ans = list(map(list, list(itertools.combinations_with_replacement([i for i in range(n)], n))))
ans = []
figures = ["a","b","c","d","e","f","g","h","i","j","k"]
for line in original_ans:
    dic = {}
    flag = 0
    ans_line = ""
    for i in range(n):
        if not line[i] in dic:
            dic[line[i]] = figures[flag]
            flag += 1
            ans_line += dic[line[i]]
        else:
            ans_line += dic[line[i]]
    ans.append(ans_line)

answers = list(set(ans))
for answer in answers:
    print(answer)
