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

from fractions import gcd



for line in sys.stdin:

    small, large = sorted(int(n) for n in line .split())

    G = gcd(large, small)

    print(G, large // G * small)
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
from fractions import gcd

for line in sys.stdin:
    small, large = sorted(int(n) for n in line.split())
    G = gcd(large, small)
    print(G, large // G * small)

-from itertools import count -    for i in count(large, large): -        if not i % small: -            lcm = i -            break -    print(gcd(large, small), lcm) +    G = gcd(large, small) +    print(G, large // G * small)