Solving congruences