from collections import deque

N = int(input())

queue = deque()
queue.append((0,)
while queue:
    s = queue.popleft()
    if len(s) == N:
        print(''.join('abcdefghij'[i] for i in s))
        continue
    for i in range(max(s) + 2):
        queue.append(s + (i,))