n=int(eval(input()))

l=[["a"],["aa","ab"],[],[],[],[],[],[],[],[]]

for i in range(2,10):

  for j in l[i-1]:

    syurui=len(set(list(j)))

    for h in range(syurui+1):

      l[i].append(j+chr(97+h))

for i in l[n-1]:print(i)
n=int(eval(input()))

l=[["a"]]+[[] for i in range(9)]

for i in range(9):

  for j in l[i]:

    k=len(set(list(j)))

    for h in range(k+1):

      l[i+1].append(j+chr(97+h))

for i in l[n-1]:print(i)

n = int(eval(input()))
l = [["a"], ["aa", "ab"], [], [], [], [], [], [], [], []]
for i in range(2, 10):
    for j in l[i - 1]:
        syurui = len(set(list(j)))
        for h in range(syurui + 1):
            l[i].append(j + chr(97 + h))
for i in l[n - 1]:
    print(i)

n = int(eval(input()))
l = [["a"]] + [[] for i in range(9)]
for i in range(9):
    for j in l[i]:
        k = len(set(list(j)))
        for h in range(k + 1):
            l[i + 1].append(j + chr(97 + h))
for i in l[n - 1]:
    print(i)

-l = [["a"], ["aa", "ab"], [], [], [], [], [], [], [], []] -for i in range(2, 10): -    for j in l[i - 1]: -        syurui = len(set(list(j))) -        for h in range(syurui + 1): -            l[i].append(j + chr(97 + h)) +l = [["a"]] + [[] for i in range(9)] +for i in range(9): +    for j in l[i]: +        k = len(set(list(j))) +        for h in range(k + 1): +            l[i + 1].append(j + chr(97 + h))