Point $M$ is arbitrarily taken on side $AC$ of a triangle $ABC$. Let $O$ be the intersection of the perpendiculars from the midpoints of segments $AM$ and $MC$ to lines $BC$ and $AB$, respectively. For which position of $M$ is the distance $OM$ minimal?