n=int(input())
a=[[] for _ in range(n)]
a[0]="a"
al=["a","b","c","d","e","f","g","h","i","j"]
b=[[] for _ in range(n)]
b[0]=[1]
for i in range(1,n):
    for j in range(len(a[i-1])):
        for k in range(b[i-1][j]+1):
            a[i].append(a[i-1][j]+al[k])
            if b[i-1][j]<=i+1:
                b[i].append(b[i-1][j])
            else:
                b[i].appemd(b[i-1][j]+1)
for i in range(len(a[n-1])):
    print(a[n-1][i])