from string import ascii_lowercase
from itertools import product
n = int(input())
alphabets = ascii_lowercase[:n]

def check(s):
    if s[0] == 'a':
        now = 'a'
        for i in range(1, n):
            if s[i] == chr(ord(now)+1) or s[i] == chr(ord(now)) or s[i] == 'a':
                now = s[i]
            else:
                return False
        return True
    return False

for s in product(alphabets, repeat=n):
    if check(s):
        print(*s, sep='')