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