import math
while True:
    try:
        x, y = map(int, input().split())
        print(str(math.gcd(x,y)) + " " + str((x * y) // math.gcd(x, y)))
    except EOFError:
        break import math math while True:
    try:
        x, y = map(int, input().split())
        print(str(math.gcd(x,y)) + " " + str((x * y) // math.gcd(x, y)))
    except EOFError:
        break True try:
        x, y = map(int, input().split())
        print(str(math.gcd(x,y)) + " " + str((x * y) // math.gcd(x, y)))
    except EOFError:
        break except EOFError:
        break break x, y = map(int, input().split()) x map(int, input().split()) map int input().split() ().split () input split y print(str(math.gcd(x,y)) + " " + str((x * y) // math.gcd(x, y))) print str(math.gcd(x,y)) + " " + str((x * y) // math.gcd(x, y)) str(math.gcd(x,y)) + " " str(math.gcd(x,y)) str math.gcd(x,y) math.gcd math gcd x y " " str((x * y) // math.gcd(x, y)) str (x * y) // math.gcd(x, y) x * y x y math.gcd(x, y) math.gcd math gcd x y y = map(int, input().split()) map(int, input().split()) y x, y = map(int, input().split()) map(int, input().split()) x
import math
while True:
    try:
        x, y = map(int, input().split())
        print(str(math.gcd(x,y)) + " " + str((x * y) // math.gcd(x, y)))
    except EOFError:
        break
