Solution for problem 33