d = ['a','b','c','d','e','f','g','h','i','j']

n = int(input())

result = []

def fig(v, num):
    if v == n:
        result.append(num)
        return
    
    for i in range(v+1):
        fig(v+1, num + d[i])

fig(0, '')
result.sort()
for r in result:
    print(r)
