import sys


def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a % b)


def lcm(a, b):
    return a * b // gcd(a, b)


def main():
    for i in sys.stdin.readlines():
        a, b = [int(x) for x in i.split()]
        print(gcd(a, b), lcm(a, b))


if __name__ == '__main__':
    main() import sys sys def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a % b) gcd if b == 0:
        return a
    else:
        return gcd(b, a % b) b == 0 b 0 return a a return gcd(b, a % b) gcd(b, a % b) gcd b a % b a b a a b b def lcm(a, b):
    return a * b // gcd(a, b) lcm return a * b // gcd(a, b) a * b // gcd(a, b) a * b a b gcd(a, b) gcd a b a a b b def main():
    for i in sys.stdin.readlines():
        a, b = [int(x) for x in i.split()]
        print(gcd(a, b), lcm(a, b)) main for i in sys.stdin.readlines():
        a, b = [int(x) for x in i.split()]
        print(gcd(a, b), lcm(a, b)) i sys.stdin.readlines() sys.stdin.readlines sys.stdin sys stdin readlines int(x) for x in i.split() for x in i.split() x i.split() i.split i split for x in i.split() int(x) int x a, b = [int(x) for x in i.split()] a [int(x) for x in i.split()] b print(gcd(a, b), lcm(a, b)) print gcd(a, b) gcd a b lcm(a, b) lcm a b if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    for i in sys.stdin.readlines():
        a, b = [int(x) for x in i.split()]
        print(gcd(a, b), lcm(a, b)) def main():
    for i in sys.stdin.readlines():
        a, b = [int(x) for x in i.split()]
        print(gcd(a, b), lcm(a, b)) main def lcm(a, b):
    return a * b // gcd(a, b) def lcm(a, b):
    return a * b // gcd(a, b) lcm def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a % b) def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a % b) gcd
import sys


def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a % b)


def lcm(a, b):
    return a * b // gcd(a, b)


def main():
    for i in sys.stdin.readlines():
        a, b = [int(x) for x in i.split()]
        print(gcd(a, b), lcm(a, b))


if __name__ == '__main__':
    main()