N = int(input())

alphabet = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"]
ans = []
original = []
for i in range(N):
    original.append("a")

usechr = original[:]
for chr in range(N):
    usechr = original[:]
    ans.append("".join(usechr[:-chr-1] + alphabet[:chr+1]))
ans.sort()

for a in ans:
    print(a)
