A scalene triangle has three unequal side lengths. The medium-length side is 7 cm longer than the shortest side. The longest side is twice as long as the shortest side. The total perimeter is 39 cm. What are the lengths of the sides of the triangle?