The measure of the perimeter of a triangle is 24x - 2. It is known that two of the sides of the triangle have measures of 10x + 2 and 8x - 1. Find the length of the third side.