It was rather a knotty problem.

Discussion