## Help understanding proof, Graham and Pollak's theorem

I need help with this proof https://ac.els-cdn.com/S009731650500...484129ad1e83ec

One the second page it says "hence we have the following:
$det(D) = det(d_{1}-d_{p}+d_{q}-d_{n}, d_{2}, ... , d_{n})$

How did they come up with that?