Solved problem 34 on PE