N = int(input())

lis = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']


def dfs(ans, keep_num, n):
    if n == N - 1:
        for i in range(keep_num + 2):
            print(ans + lis[i])
    else:
        for i in range(n + 1):
            dfs(ans + lis[i], max(i, keep_num), n + 1)


dfs('', -1, 0)
