import string

def generate(n, cur = None, alphabet = None):
    if cur is None:
        cur = []
    if alphabet is None:
        alphabet = list(string.ascii_lowercase)[::-1]
    if n == 0:
        print(''.join(cur))
        return
    for i in range(len(cur)):
        cur.append(cur[i])
        generate(n - 1, cur, alphabet)
        cur.pop()
    cur.append(alphabet.pop())
    generate(n - 1, cur, alphabet)
    alphabet.append(cur.pop())

generate(int(input()))
