N = int(input())
al = []
alphavets = "abcdefghijklmn"

def solve(N, s):

    if len(s) == N:
        al.append(s)
        return 
    
    for i in range(len(s)+1):
        solve(N, s + alphavets[i])

solve(N, alphavets[0])

al = sorted(al)
for i in al:
    print(i)