Fraction adder solved

10.	Adding fractions and simplify the results – Create a program that, when given two fractions, will add them correctly and simplify the results.
Each line of input will be four integers seperated by spaces.  The first two integers are the numerator and denominator of one fraction, and the second are the numerator and denominator of a second fraction.  Your job is to write a program that adds the fractions and simplifies the result.  You may assume that there will be no zero denominators, and the sign of the fraction will only be considered in the numerator.  Your result will be two integers per line, indicating the numerator and denominator of the sum of the corresponding input.  You may leave fractions in improper format (3/2 is fine) for the purpose of this exercise.
Sample input:
1 2 1 4 
sample output
3 4