#!/bin/sh set -eu PROOF=${PROOF:-/app/proof.md} mkdir -p "$(dirname -- "$PROOF")" cat > "$PROOF" <<'IMO_PROOF_0a597d454cf179de26e43b26798893625fccc681f9625e0eeca7bea4793a4bcd' Let $IB'$ intersect $CK$ at $Q$. \textbf{Claim. }Triangle $CB'Q$ is similar to $\triangle AIB$ (and $Q$ lies on circle $BIC$). \emph{Proof.} Since the tangent at $B'$ to the incircle, distinct from $BC$, is parallel to $AC$, and $B'I$ bisects the two tangents from $B'$, \[ \angle CB'I=\frac{1}{2}\left(180^{\circ}-\angle ACB\right)=90^{\circ}-\frac{1}{2}\angle ACB. \] Using this, we get \[ \angle CQB'=\angle CB'I-\angle BCK=90^{\circ}-\frac{1}{2}\angle ACB-\angle BAK=90^{\circ}-\frac{1}{2}(\angle ACB+\angle BAC)=\frac{1}{2}\angle CBA \] Which is enough to show $Q$ lies on circle $BIC$. Combining this with $\angle B'CQ=\angle BCK=$ $\angle BAI$ gives the similarity. Note that $K$ is the centre of circle $BIC$ so $K$ is the midpoint of $CQ$. Since $N$ is the midpoint of $AB$, $K$ and $N$ are similar points in the two triangles in the Claim so \[ \angle KB'C'=\angle KB'C=\angle AIN. \] Similarly $\angle B'C'K=\angle MIA$ so \[ \angle MIN+\angle C'KB'=\angle MIA+\angle AIN+\angle C'KB'=\angle B'C'K+\angle KB'C'+\angle C'KB'=180^{\circ}. \] IMO_PROOF_0a597d454cf179de26e43b26798893625fccc681f9625e0eeca7bea4793a4bcd