cho.sh
NotesCho Mini
Loading...

Greatest Common Divisor and Least Common Multiple

Time limit

1s

Memory limit

128 MB

Problem

Write a program that finds the greatest common divisor and least common multiple of two natural numbers.

Input

The first line contains two natural numbers A and B separated by a space. A and B are each at most 10,000.

Output

Print the greatest common divisor of A and B on the first line, and print the least common multiple of A and B on the second line.