import string

def dfs(w):
    if len(w) == N:
        print(w)
        return
    for i in range(N):
        dfs(w + string.ascii_lowercase[i])

N = int(input())
anslst = []
nlst = [0] * N
wordlst = string.ascii_lowercase
dfs('a')