A 102-inch length of ribbon is to be cut into three pieces. The longest piece is to be 38 inches longer than the shortest piece, and the third piece is to be half the length of the longest. Find the length of each ribbon.