import math

while True :
    try :
        a, b = map(int, input().split())
        Gcd = math.gcd(a, b)
        Lcm = (a * b) // Gcd
        print(Gcd, Lcm) 
    except :
        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 :
        break True try :
        a, b = map(int, input().split())
        Gcd = math.gcd(a, b)
        Lcm = (a * b) // Gcd
        print(Gcd, Lcm) 
    except :
        break except :
        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 b = map(int, input().split()) map(int, input().split()) b Gcd = math.gcd(a, b) math.gcd(a, b) Gcd Lcm = (a * b) // Gcd (a * b) // Gcd Lcm a, b = map(int, input().split()) map(int, input().split()) a
import math

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

