a='a'

exec('a=[s+chr(c)for s in a for c in range(97,ord(max(s))+2)];'*~-int(eval(input())))

print((*a))
def main():

  a='a'

  for _ in~-int(eval(input()))*a:

    a=[s+chr(c)for s in a for c in range(97,ord(max(s))+2)]

  print(('\n'.join(a)))

main()
a = "a"
exec("a=[s+chr(c)for s in a for c in range(97,ord(max(s))+2)];" * ~-int(eval(input())))
print((*a))

def main():
    a = "a"
    for _ in ~-int(eval(input())) * a:
        a = [s + chr(c) for s in a for c in range(97, ord(max(s)) + 2)]
    print(("\n".join(a)))


main()

-a = "a" -exec("a=[s+chr(c)for s in a for c in range(97,ord(max(s))+2)];" * ~-int(eval(input()))) -print((*a)) +def main(): +    a = "a" +    for _ in ~-int(eval(input())) * a: +        a = [s + chr(c) for s in a for c in range(97, ord(max(s)) + 2)] +    print(("\n".join(a))) + + +main()