Two sides of an equilateral triangle are reduced by 5 centimeters and 4 centimeters. The third side of the triangle is increased by 4 centimeters to form a right triangle. If the triangle was originally an equilateral triangle, find the length of its sides before the changes were made.