import sys
sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
from copy import deepcopy
def resolve():
    N = ir()
    ans = ['a' for _ in range(N)]
    for i in range(1<<(N-1)):
        la = deepcopy(ans)
        cnt = bin(i).count('1')
        for j in range(N):
            tmp = ord('a')
            if 1<<j & i:
                tmp += cnt
                cnt -= 1
            la[j] = chr(tmp)
        print(''.join(la[::-1]))
resolve()