from collections import *
from itertools import *
from bisect import *
from heapq import *
import copy
import math
from fractions import gcd
import sys
from decimal import *
#input = sys.stdin.readline


#N=int(input())

#A=list(map(int,input().split()))
#XY=[list(map(int,input().split())) for i in range(N)]

N=int(input())
lst=[i for i in range(1,N)]
lst2=[[] for i in range(N)]
lst2[0].append([0])

for l in lst:
    for i in range(l+1):
        for l2 in lst2[l-1]:
            lst2[l].append(l2+[i])

lst2=lst2[-1]
lst2=sorted(["".join([chr(m+ord("a"))for m in l]) for l in lst2 ])
for i in lst2:
    print(i)
