solving quadratic congruences