Question 19
Let point $P$ lie on the nine-point circle of triangle $ABC$. A line through $P$ perpendicular to $AP$ intersects $BC$ at $Q$. A line through $A$ perpendicular to $AQ$ intersects $PQ$ at $X$. Let $H$ be the orthocenter of triangle $ABC$, and let $D$ and $M$ be the midpoints of segments $BC$ and $AQ$, respectively. Prove that $XH \perp DM$.