import sys
input = sys.stdin.readline


def read():
    N = int(input().strip())
    return N,

def standalize(N):

    q = list()
    alphabets = "abcdefghijklmnopqrstuvwxyz"
    
    def dfs(i, s=[]):
        """[1, i]の範囲で文字を選択して、sの末尾に追加する
        """
        if len(s) == N:
            q.append(''.join(s))
        else:
            for j in range(1, i+2):
                a = alphabets[j-1]
                dfs(j, s + [a])
    
    dfs(1, s=['a'])
    return q

def solve(N):
    for s in standalize(N):
        print(s)

if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("%s" % outputs)
