from math import gcd

while True:
    try:
        a, b = map(int, input().split())
        print(gcd(a, b), a*b//gcd(a, b))
    except:
        break
 from math import gcd while True:
    try:
        a, b = map(int, input().split())
        print(gcd(a, b), a*b//gcd(a, b))
    except:
        break True try:
        a, b = map(int, input().split())
        print(gcd(a, b), a*b//gcd(a, b))
    except:
        break except:
        break break a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b print(gcd(a, b), a*b//gcd(a, 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, input().split()) map(int, input().split()) a b = map(int, input().split()) map(int, input().split()) b
from math import gcd

while True:
    try:
        a, b = map(int, input().split())
        print(gcd(a, b), a*b//gcd(a, b))
    except:
        break

