Forget everything you know about reducing fractions — it turns out you can just cancel common digits of the numerator and denominator:

reductio ad absurdum

Not convinced? Then there's nothing wrong with your gut feeling! The above fractions are just a couple of special cases for which the cancelling procedure (which we will refer to as reductio ad absurdum) results in an equivalent fraction. Applied to most other fractions, the procedure results in a different value. Try it out, for example, on the fraction $$\frac{12}{13}$$.

Assignment

Your task is to check whether it is allowed to apply the reductio ad absurdum technique to a given fraction. To do this, just follow these steps:

Example

>>> equivalentFraction(19, 95, 1, 5)
True
>>> equivalentFraction(532, 931, 52, 91)
True
>>> equivalentFraction(12, 13, 2, 3)
False

>>> reduction(19, 95)
(1, 5)
>>> reduction(532, 931)
(52, 91)
>>> reduction(2349, 9396)
(24, 96)
>>> reduction(12, 13)
(2, 3)
>>> reduction(11, 10)
(1, 0)
>>> reduction(123, 3214)
(-1, 4)

>>> validReduction(19, 95)
(1, 5)
>>> validReduction(532, 931)
(52, 91)
>>> validReduction(2349, 9396)
(24, 96)
>>> validReduction(12, 13)
(12, 13)
>>> validReduction(11, 10)
(11, 10)
>>> validReduction(123, 3214)
(123, 3214)