Your task is to write a program that computes the result of adding a sequence of fractions.
Using the definition
your program must include and use the function
that returns the addition of |x| and |y|, without common factors in the numerator and denominator.
Input
The input is a sequence of one or more simplified fractions separated by plus signs, ended with an equal sign. Each fraction consists of its numerator, a bar, and its denominator. Numerators and denominators are natural strictly positive.
Output
Your program must print the simplified fraction corresponding to the sum of all the given fractions.
Observations
Input
1/2 + 1/2 =
Output
1/1
Input
1/2 + 2/3 + 3/4 + 4/5 + 5/6 =
Output
71/20
Input
1/10125 + 1/8000 + 1000/999 =
Output
4801073/4795200
Input
9/4 =
Output
9/4