n = int(input())
import string
A = [chr(i) for i in range(ord("a"),ord("a")+10)]
B = {}
for i in range(10):
    B[A[i]] = i

def d(s,ANS):
    if len(s) == n:
        ANS.append(s)
    else:
        t = 0 if len(s)==0 else B[s[-1]] + 1
        for i in range(t+1):
            d(s + A[i],ANS)
ANS = []

d("",ANS)

ANS.sort()
for i in ANS:
    print(i)