n = int(input())

tank = []
res = ["a"]

for le in range(1,n):
    tank = res
    res = []
    for i in range(len(tank)):
        for j in range(le):
            res.append(tank[i] + tank[i][j])
        res.append(tank[i] + chr(le+97))
    res = list(set(res))

print(*res)