n=int(eval(input()))



abc='abcdefghijklmnopqrstuvwxyz'



def dfs(keta,s):

  if keta==n:

    global ans

    ans.append(s)

    return



  st_l=len(set(s))

  for i in range(st_l+1):

    dfs(keta+1,s+abc[i])



ans=[]

dfs(1,'a')



for i in ans:

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



abc='abcdefghij'



def dfs(s):

  if len(s)==n:

    print(s)

    return



  st_l=len(set(s))

  for i in range(st_l+1):

    dfs(s+abc[i])



dfs('a')
n = int(eval(input()))
abc = "abcdefghijklmnopqrstuvwxyz"


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


ans = []
dfs(1, "a")
for i in ans:
    print(i)

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


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


dfs("a")

-abc = "abcdefghijklmnopqrstuvwxyz" +abc = "abcdefghij" -def dfs(keta, s): -    if keta == n: -        global ans -        ans.append(s) +def dfs(s): +    if len(s) == n: +        print(s) -        dfs(keta + 1, s + abc[i]) +        dfs(s + abc[i]) -ans = [] -dfs(1, "a") -for i in ans: -    print(i) +dfs("a")