The hypotenuse of a right triangle measures 29cm. One leg is 1cm shorter than the other. What are the lengths of the legs?