solution to 39