import sys

temp = []
largest = 1

for line in sys.stdin:
    a,b = [int(x) for x in line.split()]
    if a > b:
        x,y = a,b
    else:
        x,y = b,a
    while y:
        x,y = y,x%y
    smallest = x * (a/x) * (b/x)
    print('%d %d' % (x, smallest)) import sys sys temp = [] temp [] largest = 1 largest 1 for line in sys.stdin:
    a,b = [int(x) for x in line.split()]
    if a > b:
        x,y = a,b
    else:
        x,y = b,a
    while y:
        x,y = y,x%y
    smallest = x * (a/x) * (b/x)
    print('%d %d' % (x, smallest)) line sys.stdin sys stdin int(x) for x in line.split() for x in line.split() x line.split() line.split line split for x in line.split() int(x) int x a,b = [int(x) for x in line.split()] a [int(x) for x in line.split()] b if a > b:
        x,y = a,b
    else:
        x,y = b,a
     a > b a b x,y = a,b x a y b x,y = b,a x b y a while y:
        x,y = y,x%y
     y x,y = y,x%y x y y x%y x y smallest = x * (a/x) * (b/x) smallest x * (a/x) * (b/x) x * (a/x) x a/x a x b/x b x print('%d %d' % (x, smallest)) print '%d %d' % (x, smallest) '%d %d' (x, smallest) x smallest a,b = [int(x) for x in line.split()] [int(x) for x in line.split()] a y = y,x%y x%y y x,y = y,x%y y x smallest = x * (a/x) * (b/x) x * (a/x) * (b/x) smallest x,y = b,a b x largest = 1 1 largest y = a,b b y temp = [] [] temp y = b,a a y x,y = a,b a x b = [int(x) for x in line.split()] [int(x) for x in line.split()] b
import sys

temp = []
largest = 1

for line in sys.stdin:
    a,b = [int(x) for x in line.split()]
    if a > b:
        x,y = a,b
    else:
        x,y = b,a
    while y:
        x,y = y,x%y
    smallest = x * (a/x) * (b/x)
    print('%d %d' % (x, smallest))