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