#69Medium
Sum of fractions
Time: 1 s · Memory: 256 MB
- Working with numbers
Statement
You are given two fractions and . Find their sum as an irreducible fraction .
Input format
A single line with four integers , , , ().
Output format
A single line with two numbers: and . Even if the answer is an integer, write .
Examples
Input
1 2 1 3
Output
5 6
Input
1 4 1 4
Output
1 2
Note
, then divide the numerator and the denominator by their GCD.
