from __future__ import (division, absolute_import, print_function,
                        unicode_literals)
import sys
from fractions import gcd
from itertools import count

for line in sys.stdin:
    small, large = sorted(int(n) for n in line .split())
    for i in count(large, large):
        if not i % small:
            lcm = i
            break
    print(gcd(large, small), lcm) from __future__ import (division, absolute_import, print_function,
                        unicode_literals) import sys sys from fractions import gcd from itertools import count for line in sys.stdin:
    small, large = sorted(int(n) for n in line .split())
    for i in count(large, large):
        if not i % small:
            lcm = i
            break
    print(gcd(large, small), lcm) line sys.stdin sys stdin small, large = sorted(int(n) for n in line .split()) small sorted(int(n) for n in line .split()) sorted int(n) int n large for i in count(large, large):
        if not i % small:
            lcm = i
            break
     i count(large, large) count large large if not i % small:
            lcm = i
            break
     not i % small i % small i small lcm = i lcm i break print(gcd(large, small), lcm) print gcd(large, small) gcd large small lcm small, large = sorted(int(n) for n in line .split()) sorted(int(n) for n in line .split()) small lcm = i i lcm large = sorted(int(n) for n in line .split()) sorted(int(n) for n in line .split()) large
from __future__ import (division, absolute_import, print_function,
                        unicode_literals)
import sys
from fractions import gcd
from itertools import count

for line in sys.stdin:
    small, large = sorted(int(n) for n in line .split())
    for i in count(large, large):
        if not i % small:
            lcm = i
            break
    print(gcd(large, small), lcm)