from fractions import gcd
while 1:
    try:
        a, b = map(int, raw_input().split())
        print gcd(a, b), a * b / gcd(a, b)
    except:
        break from fractions import gcd while 1:
    try:
        a, b = map(int, raw_input().split())
        print gcd(a, b), a * b / gcd(a, b)
    except:
        break 1 try:
        a, b = map(int, raw_input().split())
        print gcd(a, b), a * b / gcd(a, b)
    except:
        break except:
        break break a, b = map(int, raw_input().split()) a map(int, raw_input().split()) map int raw_input().split() ().split () raw_input split b print gcd(a, b) gcd a b a * b / gcd(a, b) a * b a b gcd(a, b) gcd a b a, b = map(int, raw_input().split()) map(int, raw_input().split()) a b = map(int, raw_input().split()) map(int, raw_input().split()) b
from fractions import gcd
while 1:
    try:
        a, b = map(int, raw_input().split())
        print gcd(a, b), a * b / gcd(a, b)
    except:
        break