The longest side of a triangle is 5 inches longer than the shortest side. The medium size is 4 inches longer than the shortest side. If the perimeter of the triangle is 30 ​inches, what are the lengths of the three​ sides?