Chosen-Ciphertext Attack on Rabin: Factorize n At the end of this Wikipedia section, you can see that $$\gcd(|r-s|,n)=q$$ or $$\gcd(|r-s|,n)=p$$ holds. I don't understand why.
By following the above advice (taking the equations for r and s given in the article and writing r-s) you will notice that q is  a divisor, therefore GCD(|r-s|,n) cannot be 1. There are only two options left since n is only divisible by q and p.