Skip to content
UPEEC

GCD and LCM

Easy#math#number-theory· solved by 0 · time limit 2.0 s

Print the greatest common divisor and the least common multiple of aa and bb.

Hint: Euclid's algorithm — gcd⁡(a,b)=gcd⁡(b,a mod b)\gcd(a, b) = \gcd(b, a \bmod b) — and lcm(a,b)=a/gcd⁡(a,b)×b\text{lcm}(a,b) = a / \gcd(a,b) \times b.

Input

Two positive integers aa and bb.

Output

gcd⁡\gcd and lcm\text{lcm} separated by a space.

Constraints

1≤a,b≤1091 \le a, b \le 10^9 — the LCM can need 64 bits.

Sample 1

Input

12 18

Output

6 36

Sample 2

Input

7 5

Output

1 35

Sign in or join free to run and submit your solution.