from math import gcd class Fraction: def __init__(self,x,y): g=gcd(x,y) self.x=x//g self.y=y//g def __lt__(self,other): return self.x*other.y