The centers of three circles, each touching the other two externally, are located at the vertices of a right triangle. These circles are internally tangent to a fourth circle. Find the radius of the fourth circle if the perimeter of the right triangle is $2 p$.

#
Consider a right triangle $ABC\left(\angle C=90^{\circ}\right)$, where the vertices are the centers of circles. Let the radii of these circles be $r 1, r 2, r 3$, and

$$
AC=r 1+r 2, BC=r 1+r 3, AB=r 2+r 3
$$

Construct a circle of radius $p$ with center at vertex $D$ of the rectangle $ACBD$. Since

$$
DC=AB=r 2+r 3=p-r 1, DA=p-r 2, DB=p-r 3
$$

the circles centered at points $C, A$, and $B$ touch the circle centered at point $D$ from the inside. It remains to prove that the found circle is unique.

## Answer

$p$.