Solves Problem 37