c = 'abcdefghij'

def join(s, k, n):
    if len(s) == n:
        return [s]
    ans = []
    for i in range(n - len(s), 0, -1):
        ans += join(s + c[k] * i, k + 1, n)
    return ans

n = int(input())
ans = join('', 0, n)
for x in ans:
    print(x)
