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

    try:
        a, b = map(int, input().split())
    except EOFError:
        break
    print(str(gcd(b, a%b)) + " " + str(int(lcm(a, b)))) while True:
    def gcd(a, b):
        if b == 0:
            return a
        else:
            return gcd(b, a%b)
    def lcm(a, b):
        return a*b/gcd(a, b)

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

    try:
        a, b = map(int, input().split())
    except EOFError:
        break
    print(str(gcd(b, a%b)) + " " + str(int(lcm(a, b))))
