eolymp
bolt
Try our new interface for solving problems
Problems

Reduce a fraction

Reduce a fraction

Reduce the given fraction to lowest terms. \InputFile The numerator and denominator of the fraction (integers, no more than $10^9$ by absolute value). \OutputFile Print the numerator and denominator of the simplified fraction.
Time limit 1 second
Memory limit 128 MiB
Input example #1
2 4
Output example #1
1 2
Input example #2
-12 15
Output example #2
-4 5