#!python3

iim = lambda: map(int, input().rstrip().split())
from collections import deque

def resolve():
    N = int(input())
    S = "abcdefghij"

    q = deque([("", 0, 0)])
    while q:
        s1, i1, i2 = q.popleft()

        if i1 == N:
            print(s1)
            continue
        for i in range(i1):
            q.append((s1+S[i], i1+1, i2))
        q.append((s1+S[i1], i1+1, i2+1))



if __name__ == "__main__":
    resolve()
