All tasks
Mediummath

GCD and LCM

Time limit 2 s · Memory 64 MB

Statement

One line contains two positive integers a and b. Print their greatest common divisor (GCD) and least common multiple (LCM) separated by a space.

Constraints

1 ≤ a, b ≤ 10^9

Examples

Input 1
12 18
Output 1
6 36
Input 2
7 13
Output 2
1 91
Solve this task to unlock the editorial.

AI tutor

Stuck? Get a nudge — the tutor explains the idea, it never hands you the solution.