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

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

if __name__ == "__main__":
    main()