# coding: utf-8
n = int(input())

alphas = "abcdefghij"
init_str = ""

def standard(moji, x):
    if len(moji) == n:
        print(moji)
    else:
        for j in range(x):
            if j == x:
                standard(moji + alphas[j], i + 1)
            else:
                standard(moji + alphas[j], i)


standard(init_str, 0)
