# https://atcoder.jp/contests/panasonic2020/tasks/panasonic2020_d

n = int(input())

def dfs(s, n, path):
    if n == 0:
        path.append(s)
        return
    for i in range(n):
        dfs(chr(i + ord('a')) + s, n - 1, path)


path = []
dfs('', n, path)
for ans in path:
    print(ans)