k = "a",

for _ in range(int(input()) - 1):

  k = {a + b for a in k for b in a + chr(ord(max(a)) + 1)}

print(*sorted(k), sep='\n')

k = "a",

for _ in range(int(eval(input())) - 1):

  k = {a + b for a in k for b in a + chr(ord(max(a)) + 1)}

for i in sorted(k):print(i)
k = ("a",)
for _ in range(int(input()) - 1):
    k = {a + b for a in k for b in a + chr(ord(max(a)) + 1)}
print(*sorted(k), sep="\n")

k = ("a",)
for _ in range(int(eval(input())) - 1):
    k = {a + b for a in k for b in a + chr(ord(max(a)) + 1)}
for i in sorted(k):
    print(i)

-for _ in range(int(input()) - 1): +for _ in range(int(eval(input())) - 1): -print(*sorted(k), sep="\n") +for i in sorted(k): +    print(i)