import math
while True:
    try:
        a, b = map(int, input().split())
        gcd = math.gcd(a, b)
        lcm = (a * b) // gcd
        print(gcd, lcm)
    except Exception:
        break
 import math math while True:
    try:
        a, b = map(int, input().split())
        gcd = math.gcd(a, b)
        lcm = (a * b) // gcd
        print(gcd, lcm)
    except Exception:
        break True try:
        a, b = map(int, input().split())
        gcd = math.gcd(a, b)
        lcm = (a * b) // gcd
        print(gcd, lcm)
    except Exception:
        break except Exception:
        break break a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b gcd = math.gcd(a, b) gcd math.gcd(a, b) math.gcd math gcd a b lcm = (a * b) // gcd lcm (a * b) // gcd a * b a b gcd print(gcd, lcm) print gcd lcm lcm = (a * b) // gcd (a * b) // gcd lcm a, b = map(int, input().split()) map(int, input().split()) a b = map(int, input().split()) map(int, input().split()) b gcd = math.gcd(a, b) math.gcd(a, b) gcd
import math
while True:
    try:
        a, b = map(int, input().split())
        gcd = math.gcd(a, b)
        lcm = (a * b) // gcd
        print(gcd, lcm)
    except Exception:
        break

