import sys
sys.setrecursionlimit(10**5+10)
alp = 'abcdefghij'
N = int(input())
ans = []
def an(i,s):
    global ans
    if i == N:
        ans.append(s)
    else:
        for j in range(i+1):
            an(i+1,s+alp[j])
        
an(0,'')
ans.sort()
for i in ans:
    print(i)