n=int(eval(input()))

def b(s):

  if len(s)==n:

    print(s)

    return

  for i in "abcdefghijklmnopqrstuvwxyz":

    b(s+i)

    if max(list(s))==chr(ord(i)-1):return

b("a")
t="abcdefghijklmnopqrstuvwxyz"

n=int(eval(input()))

ans=[]

def dfs(s):

  global ans

  if len(s)==n:

    ans.append(s)

    return 

  for i in range(len(set(s))+1):dfs(s+t[i])

  return

dfs("")

ans.sort()

for i in ans:print(i)
n = int(eval(input()))


def b(s):
    if len(s) == n:
        print(s)
        return
    for i in "abcdefghijklmnopqrstuvwxyz":
        b(s + i)
        if max(list(s)) == chr(ord(i) - 1):
            return


b("a")

t = "abcdefghijklmnopqrstuvwxyz"
n = int(eval(input()))
ans = []


def dfs(s):
    global ans
    if len(s) == n:
        ans.append(s)
        return
    for i in range(len(set(s)) + 1):
        dfs(s + t[i])
    return


dfs("")
ans.sort()
for i in ans:
    print(i)

+t = "abcdefghijklmnopqrstuvwxyz" +ans = [] -def b(s): +def dfs(s): +    global ans -        print(s) +        ans.append(s) -    for i in "abcdefghijklmnopqrstuvwxyz": -        b(s + i) -        if max(list(s)) == chr(ord(i) - 1): -            return +    for i in range(len(set(s)) + 1): +        dfs(s + t[i]) +    return -b("a") +dfs("") +ans.sort() +for i in ans: +    print(i)