n = int(input())
cs = 'abcdefghijklmn'
cm = {cs[i]:i for i in range(len(cs))}

def rec(string, l):
    if (l >= n):
        print(string)
        return 0
    now = string[-1]
    k = cm[now] + 2
    for c in cs[:k]:
        rec(string + c,l+1)

rec('a',1)