An isosceles triangle has two equal angles. if the measure of the third angle is 40 degrees less than the sum of the two equal​ angles, find the measures of the three angles.