def gcd(m, n): while m % n != 0: m, n = n, m % n return n
class Fraction: def init(self, top, bottom): if not isinstance(top, int): raise ValueError(&quo