Solve problem 51