import sys
from collections import *
import heapq
import math
import bisect
from itertools import permutations,accumulate,combinations,product
from fractions import gcd
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
mod=pow(10,9)+7

n=int(input())
al=[chr(ord('a') + i) for i in range(26)]
d=deque([])
d.append([0])
# print(d)
while 1:
    if len(d[0])==n:
        break
    tmp=d.popleft()
    for i in range(tmp[-1]+2):
        d.append(tmp+[i])
    
for i in range(len(d)):
    tmp=""
    for j in range(len(d[0])):
        tmp+=al[d[i][j]]
    print(tmp)