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

if __name__ == '__main__':
    for line in sys.stdin:
        a,b = map(int,line.split())
        print(int(fractions.gcd(a,b)),lcm(a,b)) import sys sys import fractions fractions def lcm(a,b):
    return int(a*b/fractions.gcd(a,b)) lcm return int(a*b/fractions.gcd(a,b)) int(a*b/fractions.gcd(a,b)) int a*b/fractions.gcd(a,b) a*b a b fractions.gcd(a,b) fractions.gcd fractions gcd a b a a b b if __name__ == '__main__':
    for line in sys.stdin:
        a,b = map(int,line.split())
        print(int(fractions.gcd(a,b)),lcm(a,b)) __name__ == '__main__' __name__ '__main__' for line in sys.stdin:
        a,b = map(int,line.split())
        print(int(fractions.gcd(a,b)),lcm(a,b)) line sys.stdin sys stdin a,b = map(int,line.split()) a map(int,line.split()) map int line.split() line.split line split b print(int(fractions.gcd(a,b)),lcm(a,b)) print int(fractions.gcd(a,b)) int fractions.gcd(a,b) fractions.gcd fractions gcd a b lcm(a,b) lcm a b a,b = map(int,line.split()) map(int,line.split()) a b = map(int,line.split()) map(int,line.split()) b def lcm(a,b):
    return int(a*b/fractions.gcd(a,b)) def lcm(a,b):
    return int(a*b/fractions.gcd(a,b)) lcm
import sys
import fractions
def lcm(a,b):
    return int(a*b/fractions.gcd(a,b))

if __name__ == '__main__':
    for line in sys.stdin:
        a,b = map(int,line.split())
        print(int(fractions.gcd(a,b)),lcm(a,b))