# -*- coding: utf-8 -*-
import sys
import fractions

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

for s in sys.stdin:
    a,b = map(int,s.split())
    gcd_ab = fractions.gcd(a,b)
    lcm_ab = lcm(a,b)

    print gcd_ab,lcm_ab import sys sys import fractions fractions def lcm(a,b):
    return a / fractions.gcd(a,b) * b lcm return a / fractions.gcd(a,b) * b a / fractions.gcd(a,b) * b a / fractions.gcd(a,b) a fractions.gcd(a,b) fractions.gcd fractions gcd a b b a a b b for s in sys.stdin:
    a,b = map(int,s.split())
    gcd_ab = fractions.gcd(a,b)
    lcm_ab = lcm(a,b)

    print gcd_ab,lcm_ab s sys.stdin sys stdin a,b = map(int,s.split()) a map(int,s.split()) map int s.split() s.split s split b gcd_ab = fractions.gcd(a,b) gcd_ab fractions.gcd(a,b) fractions.gcd fractions gcd a b lcm_ab = lcm(a,b) lcm_ab lcm(a,b) lcm a b print gcd_ab lcm_ab gcd_ab = fractions.gcd(a,b) fractions.gcd(a,b) gcd_ab def lcm(a,b):
    return a / fractions.gcd(a,b) * b def lcm(a,b):
    return a / fractions.gcd(a,b) * b lcm a,b = map(int,s.split()) map(int,s.split()) a b = map(int,s.split()) map(int,s.split()) b lcm_ab = lcm(a,b) lcm(a,b) lcm_ab
# -*- coding: utf-8 -*-
import sys
import fractions

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

for s in sys.stdin:
    a,b = map(int,s.split())
    gcd_ab = fractions.gcd(a,b)
    lcm_ab = lcm(a,b)

    print gcd_ab,lcm_ab