The Montgomery Company tells Squeaky Clean that most of their buildings are 40 feet tall. Squeaky Clean decides to use ladders to reach the upper windows. The base of the ladder works best on the sidewalk so it needs to be 9 feet away from the building. How tall should the ladder be in order to reach the top of the building?