Page not loading? Try clicking here.
Placeholder

#1658

Greatest Common Divisor and Least Common Multiple 1s 64MB

Problems

Write a program that, given two natural numbers, outputs their greatest common divisor and their least common multiple.


Input

The first line of input contains two natural numbers separated by a space.
Both numbers are natural numbers not exceeding 10,000.


Output

Print the greatest common divisor of the two numbers on the first line, and their least common multiple on the second line.


Example

24 18
6

72


Source

KOI 본선 2004 중1/고1

You must sign in to write code.