import sys
sys.setrecursionlimit(10 ** 7)
ans = []
def solve(x, y, m, n, s):
    if m == n:
        ans.append(s)
        return
    for i in range(x, y):
        solve(i, y+1, m+1, n, s + chr(ord("a") + i))

def main():
    n = int(input())
    solve(0, 2, 1, n, "a")
    ans.sort()
    for s in ans:
        print(s)

if __name__ == "__main__":
    main()