n = int(input())

def normal_form(x):
    if x == 1:
        return ['a']
    temp = normal_form(x-1)
    res = []
    for i, s in enumerate(temp):
        if i == 0:
            k = 2
        elif i == len(temp)-1:
            k = x
        else:
            k = x-1
        for j in range(k):
            res.append(s+chr(j+97))
    return res

print('\n'.join(normal_form(n)))
