Let $\theta_1=\angle APB$. By the Cosine Law, $$AB^2=AP^2+25-2(AP)(5)\cos\theta_1.$$ Let $\theta_2=\angle APQ$. Note that $\cos\theta_2=-\cos\theta_1$, since $\theta_1+\theta_2=180^\circ$. So by the Cosine Law, $$AQ^2=AP^2+25+2(AP)(5)\cos\theta_1.$$
Add up. We get $$AB^2+AQ^2=2AP^2+50.\tag{$1$}$$ Note the pretty cancellation!
We played a certain game at $P$. Play the same game at $R$. We get $$AC^2+AQ^2=2AR^2+50.\tag{$2$}$$ Add $(1)$ and $(2)$, and use the Pythagorean Theorem. We get $400+2AQ^2=2AP^2+2AR^2+100$, and dividing by $2$, $$AP^2+AR^2=AQ^2+150.$$
Play a similar game at $Q$, but using the double triangles $AQB$ and $AQC$. We get $$AB^2+AC^2=2AQ^2+200,$$ so $AQ^2=100$. (This calculation is more standard: it is how we obtain a formula for the length of a median, given the sides of a triangle.)
Thus $AP^2+AR^2=250$, and therefore $AP^2+AQ^2+AR^2=350$.