#{(21-=385" (mod x)"), (587 -= 167" (mod x)"):}#
#<=>{(364-=0" (mod x)"), (420 -= 0" (mod x)"):}#
(by subtracting #21# from each side of the first congruency, and #167# from each side of the second)
#<=> {(364 = k_1x" for some "k_1inZZ), (420 = k_2x" for some "k_2inZZ):}#
Thus, as all of the above steps are reversible, #x# is the greatest integer which divides both #364# and #420#. We can find this using the Euclidean algorithm:
#420 = 1xx364 + 56#
#364 = 6xx56 + 28#
#56 = 2xxcolor(red)(28) + 0#
Thus #x = "gcd"(420,364) = 28#