import math
import queue

n = int(input())

q = queue.Queue()
q.put("a")

while True:
    c = q.get()
    if len(c) > n:
        break
    if len(c) == n:
        print(c)

    nx = c[-1]
    if nx != "a":
        q.put(c + chr(ord(nx) - 1))
    q.put(c + nx)
    q.put(c + chr(ord(nx) + 1))
