
#include <string>
#include <iostream>
#include <sstream>

long __gcd(long a, long b)
{
//    std::cout << "in __gcd\n";
//    std::cout << "a: " << a << "\nb: " << b << '\n';
    if (b % a == 0) {
//        std::cout << "returning " << a << '\n';
        return a;
    } else {
        return __gcd(b % a ,a);
    }
}

long gcd(long a, long b)
{
    if (a > b)
        return __gcd(b, a);
    return __gcd(a, b);
}

long lcm(long a, long b)
{
    return a * b / gcd(a, b);
}

int main(void)
{
    int a, b;
    std::string str;

    while (getline(std::cin, str)) {
        std::istringstream str_s(str);
        str_s >> a >> b;

        std::cout << gcd(a, b) << ' ' << lcm(a, b) << '\n';
    }
    
    return 0;
}