import sys

def gcd(a,b):
    if(b):
        return gcd(b,(a%b))
    else:
        return a

def lcm(a,b):
    return a*b/gcd(a,b)

a = ""
for input in sys.stdin:
    a += input
l = a.split()
for i in range(0,len(l),2):
    if(int(l[i]) > int(l[i+1])):
        print gcd(int(l[i]),int(l[i+1])),lcm(int(l[i]),int(l[i+1]))
    else:
        print gcd(int(l[i+1]),int(l[i])),lcm(int(l[i+1]),int(l[i])) import sys sys def gcd(a,b):
    if(b):
        return gcd(b,(a%b))
    else:
        return a gcd if(b):
        return gcd(b,(a%b))
    else:
        return a b return gcd(b,(a%b)) gcd(b,(a%b)) gcd b a%b a b return a a a a b b def lcm(a,b):
    return a*b/gcd(a,b) lcm return a*b/gcd(a,b) a*b/gcd(a,b) a*b a b gcd(a,b) gcd a b a a b b a = "" a "" for input in sys.stdin:
    a += input input sys.stdin sys stdin a += input a input l = a.split() l a.split() a.split a split for i in range(0,len(l),2):
    if(int(l[i]) > int(l[i+1])):
        print gcd(int(l[i]),int(l[i+1])),lcm(int(l[i]),int(l[i+1]))
    else:
        print gcd(int(l[i+1]),int(l[i])),lcm(int(l[i+1]),int(l[i])) i range(0,len(l),2) range 0 len(l) len l 2 if(int(l[i]) > int(l[i+1])):
        print gcd(int(l[i]),int(l[i+1])),lcm(int(l[i]),int(l[i+1]))
    else:
        print gcd(int(l[i+1]),int(l[i])),lcm(int(l[i+1]),int(l[i])) int(l[i]) > int(l[i+1]) int(l[i]) int l[i] l i int(l[i+1]) int l[i+1] l i+1 i 1 print gcd(int(l[i]),int(l[i+1])) gcd int(l[i]) int l[i] l i int(l[i+1]) int l[i+1] l i+1 i 1 lcm(int(l[i]),int(l[i+1])) lcm int(l[i]) int l[i] l i int(l[i+1]) int l[i+1] l i+1 i 1 print gcd(int(l[i+1]),int(l[i])) gcd int(l[i+1]) int l[i+1] l i+1 i 1 int(l[i]) int l[i] l i lcm(int(l[i+1]),int(l[i])) lcm int(l[i+1]) int l[i+1] l i+1 i 1 int(l[i]) int l[i] l i l = a.split() a.split() l a = "" "" a def gcd(a,b):
    if(b):
        return gcd(b,(a%b))
    else:
        return a def gcd(a,b):
    if(b):
        return gcd(b,(a%b))
    else:
        return a gcd def lcm(a,b):
    return a*b/gcd(a,b) def lcm(a,b):
    return a*b/gcd(a,b) lcm a += input input a
import sys

def gcd(a,b):
    if(b):
        return gcd(b,(a%b))
    else:
        return a

def lcm(a,b):
    return a*b/gcd(a,b)

a = ""
for input in sys.stdin:
    a += input
l = a.split()
for i in range(0,len(l),2):
    if(int(l[i]) > int(l[i+1])):
        print gcd(int(l[i]),int(l[i+1])),lcm(int(l[i]),int(l[i+1]))
    else:
        print gcd(int(l[i+1]),int(l[i])),lcm(int(l[i+1]),int(l[i]))
