Question #2 -- Rational Arithmetic

Write a program which performs rational arithmetic (+, -, *, /) on a pair of rational numbers.

For example:


   4/5 * 2/3 = 8/15

   5/6 + 1/4 = 26/24 = 13/12

Note that the final answer is in reduced form, with no common factors between numerator and denominator.

Input is three lines:


   numerator/denominator
   operator
   numerator/denominator

E.g.,

   4/5
    +
   7/9