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