The incircle of a scalene triangle $ABC$ touches the sides $BC, CA$, and $AB$ at points $D, E$, and $F$, respectively. Triangles $APE$ and $AQF$ are constructed outside the triangle so that \[AP =PE, AQ=QF, \angle APE=\angle ACB,\text{ and }\angle AQF =\angle ABC.\]Let $M$ be the midpoint of $BC$. Find $\angle QMP$ in terms of the angles of the triangle $ABC$. Iran, Shayan Talaei