import string

normal_set = set()
def reccursion(n, _s):
    if len(_s) == n:
        global normal_set
        normal_set.add(_s)
        return

    for i in range(len(_s) + 1):
        next_s = _s + string.ascii_lowercase[i]
        reccursion(n, next_s)

def solve():
    n = int(input())
    reccursion(n, "")

    global normal_set
    normal_set = sorted(list(normal_set))
    
    for _s in normal_set:
        print(_s)

if __name__ == "__main__":
    solve()