The first side of a triangle is 9 m shorter than the second side the third side is three times as long as the first side the perimeter is 39 m find the length of the longest side.