def gcd(a,b): return a if b==0 else gcd(b,a%b)
def lcm(a,b): return a*b/gcd(a,b)

while 1:
    try:
        a,b=map(int,raw_input().split())
        print gcd(a,b),lcm(a,b)
    except:
        break def gcd(a,b): return a if b==0 else gcd(b,a%b) gcd a a b b def lcm(a,b): return a*b/gcd(a,b) lcm a a b b while 1:
    try:
        a,b=map(int,raw_input().split())
        print gcd(a,b),lcm(a,b)
    except:
        break 1 try:
        a,b=map(int,raw_input().split())
        print gcd(a,b),lcm(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 lcm(a,b) lcm a b b=map(int,raw_input().split()) map(int,raw_input().split()) b a,b=map(int,raw_input().split()) map(int,raw_input().split()) a def lcm(a,b): return a*b/gcd(a,b) def lcm(a,b): return a*b/gcd(a,b) lcm def gcd(a,b): return a if b==0 else gcd(b,a%b) def gcd(a,b): return a if b==0 else gcd(b,a%b) gcd
def gcd(a,b): return a if b==0 else gcd(b,a%b)
def lcm(a,b): return a*b/gcd(a,b)

while 1:
    try:
        a,b=map(int,raw_input().split())
        print gcd(a,b),lcm(a,b)
    except:
        break