n = int(eval(input()))

v = 'abcdefghijk'



w = []

def dfs(s,t):

  if len(s) == n:

    w.append(s)

    return

  u = len(set(s))

  for i in range(u+1):

    dfs(s+v[i],u+1)



dfs('a',1)



for i in w:

  print (i)
n = int(eval(input()))

v = 'abcdefghij'

def dfs(s):

  if len(s) == n:

    print (s)

    return

  for i in range(len(set(s))+1):

    dfs(s+v[i])

dfs('a')
n = int(eval(input()))
v = "abcdefghijk"
w = []


def dfs(s, t):
    if len(s) == n:
        w.append(s)
        return
    u = len(set(s))
    for i in range(u + 1):
        dfs(s + v[i], u + 1)


dfs("a", 1)
for i in w:
    print(i)

n = int(eval(input()))
v = "abcdefghij"


def dfs(s):
    if len(s) == n:
        print(s)
        return
    for i in range(len(set(s)) + 1):
        dfs(s + v[i])


dfs("a")

-v = "abcdefghijk" -w = [] +v = "abcdefghij" -def dfs(s, t): +def dfs(s): -        w.append(s) +        print(s) -    u = len(set(s)) -    for i in range(u + 1): -        dfs(s + v[i], u + 1) +    for i in range(len(set(s)) + 1): +        dfs(s + v[i]) -dfs("a", 1) -for i in w: -    print(i) +dfs("a")