gcd, reverse mod