n = int(input())
alp='abcdefghij'
ansls=[list() for _ in range(n)]
ansls[0]=['a']
for i in range(1,n):
    for j in range(i+1):
        for s in ansls[i-1]:
            aps = s + alp[j]
            ansls[i].append(aps)

ansls[-1].sort()
for s in ansls[-1]:
    print(s)
