Time limit
1s
Memory limit
128 MB
Write a program that finds the greatest common divisor and least common multiple of two natural numbers.
The first line contains two natural numbers A and B separated by a space. A and B are each at most 10,000.
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.