def gcd(x,y):
    return gcd(y,x % y) if y > 0 else x

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

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

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

while(1):
    try:
        x,y = (int(x) for x in input().split())
        print(gcd(x,y),lcm(x,y))
    except:
        break
