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
    c = s[-1]
    for i in range(c + 2):
        queue.append(s + (i,))