n = int(input())
a = [ [] for _ in range(11) ]
a[0].append("a")

alp = "abcdefghijklmn"
for i in range(1, 10):
    for aa in a[i-1]:
        for c in alp[:i+1]:
            a[i].append(aa+c)

for ans in a[n-1]:
    print(ans)
