import sys
import time
sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline
N = int(input())

groups = []

def dfs(s, n):
    if n == N:
        print(s)
        return True
    # for ns in 'abcdefghijklmnopqrstuvwxyz'[:n+1]:
    for i, ns in enumerate('abcdefghij'[:n+1]):
        dfs(s+ns, max(i, n+1))

dfs('', 0)
