In triangle $A B C$, sides $C B$ and $C A$ are equal to $a$ and $b$ respectively. The bisector of angle $A C B$ intersects side $A B$ at point $K$, and the circumcircle of triangle $A B C$ - at point $M$. The circumcircle of triangle $A M K$ intersects line $C A$ again at point $P$. Find $A P$.
$\angle A P K=\angle A M C=\angle C B A ;$ triangles СКР and СКВ are equal.

## Solution

Assume that $a>b$. $\angle A P K=\angle A M C$ (as inscribed angles subtended by the same arc), and $\angle K B C=\angle A B C=$ $\angle A M C=\angle A M K=\angle A P K$. Therefore, triangles $В K С$ and $Р K С$ are equal by side and three angles. Thus, $C P=B C=$ a. Therefore, $A P=C P-A C=a-b$.

If $a<b$, then similarly we get that $A P=b-a$.

## Answer

$|a-b|$.