solve problem 97