Let the equation of the plane $P$ containing the line $x+10=\frac{8-y}{2}=z$ be $ax+by+3z=2(a+b)$ and the distance of the plane $P$ from the point $(1, 27, 7)$ be $c$. Then $a^2+b^2+c^2$ is equal to _______.