s = 'abcdefghij'
sg = s.__getitem__


def dfs(ans):
    if len(ans) == n:
        print(''.join(map(sg, ans)))
        return
    for i in range(ans[-1] + 2):
        ans.append(i)
        dfs(ans)
        ans.pop()


n = int(input())
dfs([0])
