If the two legs of a right triangle measure 5 and 12 respectively, and the leg and hypotenuse of another right triangle measure 12 and 13 respectively, explain why the triangles would be congruent.