One side of a triangle is half the longest side. The third side is 8 feet less than the longer side. The perimeter is 47. Find all three sides.