I like Slylok's idea, ts is really interesting. Perhaps too complicated for an easy contest its a great overview for a the logistics of one method to do this, and I don't myself have any quick ways to simplify it.