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