from math import gcd
from sys import stdin

for line in stdin:
    a,b = [int(i) for i in line.split()]
    g = gcd(a,b)
    print(g,int(a*b/g)) from math import gcd from sys import stdin for line in stdin:
    a,b = [int(i) for i in line.split()]
    g = gcd(a,b)
    print(g,int(a*b/g)) line stdin int(i) for i in line.split() for i in line.split() i line.split() line.split line split for i in line.split() int(i) int i a,b = [int(i) for i in line.split()] a [int(i) for i in line.split()] b g = gcd(a,b) g gcd(a,b) gcd a b print(g,int(a*b/g)) print g int(a*b/g) int a*b/g a*b a b g b = [int(i) for i in line.split()] [int(i) for i in line.split()] b g = gcd(a,b) gcd(a,b) g a,b = [int(i) for i in line.split()] [int(i) for i in line.split()] a
from math import gcd
from sys import stdin

for line in stdin:
    a,b = [int(i) for i in line.split()]
    g = gcd(a,b)
    print(g,int(a*b/g))