import fileinput

for line in fileinput.input():
    tokens = list(map(int, line.strip().split()))
    a, b = tokens[0], tokens[1]
    d = a * b
    if a < b:
        tmp = a
        a = b
        b = tmp

    c = a % b
    while(c != 0):
        a = b
        b = c
        c = a % b

    g = b
    l = d / g

    print(str(g)+" "+str(int(l))) import fileinput fileinput for line in fileinput.input():
    tokens = list(map(int, line.strip().split()))
    a, b = tokens[0], tokens[1]
    d = a * b
    if a < b:
        tmp = a
        a = b
        b = tmp

    c = a % b
    while(c != 0):
        a = b
        b = c
        c = a % b

    g = b
    l = d / g

    print(str(g)+" "+str(int(l))) line fileinput.input() fileinput.input fileinput input tokens = list(map(int, line.strip().split())) tokens list(map(int, line.strip().split())) list map(int, line.strip().split()) map int line.strip().split() line.strip().split line.strip() line.strip line strip split a, b = tokens[0], tokens[1] a tokens[0] tokens 0 b tokens[1] tokens 1 d = a * b d a * b a b if a < b:
        tmp = a
        a = b
        b = tmp

     a < b a b tmp = a tmp a a = b a b b = tmp b tmp c = a % b c a % b a b while(c != 0):
        a = b
        b = c
        c = a % b

     c != 0 c 0 a = b a b b = c b c c = a % b c a % b a b g = b g b l = d / g l d / g d g print(str(g)+" "+str(int(l))) print str(g)+" "+str(int(l)) str(g)+" " str(g) str g " " str(int(l)) str int(l) int l b = tmp tmp b d = a * b a * b d tmp = a a tmp b = c c b a, b = tokens[0], tokens[1] tokens[0] a c = a % b a % b c c = a % b a % b c a = b b a g = b b g a = b b a tokens = list(map(int, line.strip().split())) list(map(int, line.strip().split())) tokens l = d / g d / g l b = tokens[0], tokens[1] tokens[1] b
import fileinput

for line in fileinput.input():
    tokens = list(map(int, line.strip().split()))
    a, b = tokens[0], tokens[1]
    d = a * b
    if a < b:
        tmp = a
        a = b
        b = tmp

    c = a % b
    while(c != 0):
        a = b
        b = c
        c = a % b

    g = b
    l = d / g

    print(str(g)+" "+str(int(l)))