Maybe I'm misunderstanding the requirements, but I was confident that I had found a solution.