N = int(input()) # 数字を変数に格納

List = [[] for i in range(N)]

for i in range(N):
    for j in range(i+1):
        List[i].append(chr(97+j))

flag = 0
point = [0]*(N+1)

while flag != 1:
    chars = ''
    i = 0
    while len(chars) < N:
        if i != 0 and point[i-1]+1 < point[i]:
            point[i-1] += 1
            point[i] = 0
            break
        chars += List[i][point[i]]
        if i == N-1:
            point[i] += 1
        if point[i] == N:
            flag = 1
        i += 1
    if len(chars) == N:
        print(chars)    