import sys
sys.setrecursionlimit(10 ** 7)

n = int(input())
ans = []

if n == 1:
    print('a')
    exit()

def rec(before, depth):
    if len(before) >= n-1:
        for i in range(ord(before[-1])-ord('a') +2):
            tmp = before + chr(ord('a') + i)
            ans.append(tmp)
    else:
        for i in range(ord(before[-1])-ord('a') +2):
            tmp = before + chr(ord('a') + i)
            rec(tmp, depth+1)


rec('a',1)

print(*ans, sep ='\n')
