Solved problem 56 on PE