A,B,C=$<.map &:to_i D=A*B*C S=B*(C-A).abs T=B*(C+A) U=A*(C-B).abs V=A*(C+B) puts Rational(D,[S.gcd(U),S.gcd(V),T.gcd(U),T.gcd(V)].max)