problem 33 naive solution