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