import string

def dfs(s,n):
    if n == N:
        print(s)
        return
    else:
        # print(s,n)
        for i in range(N-n):
            dfs(string.ascii_lowercase[i]+s,n+1)

N = int(input())
dfs("",0)