#coding: utf-8

n = int(input())

def f(level):
    if level == 1:
        return ["a"]
    ret = []
    for x in f(level-1):
        for c in range(ord("a"), ord(x[-1])+2):
            ret.append(x + chr(c))
    return ret

print("\n".join(f(n)))

