A right triangle has side lengths 216 millimeters, 405 millimeters, and 459 millimeters. What are the lengths of the legs and why?