Euclid Problem
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
From Euclid it is known that for any positive integers and there exist such integers and that , where is the greatest common divisor of and . The problem is to find for given and corresponding and .
Input
Each line contains two positive integers and .
Output
For each test case print in a separate line three integers and . If there are several such and , print the pair for which is minimal. If there also exist multiple answers, print the pair with minimum value of .
Examples
Input #1
Answer #1
Submissions 3K
Acceptance rate 44%