#include <iostream>
#include <iomanip>

int gcd(int x, int y)
{
    if(x < y){
        std::swap(x, y);
    }
    while(y > 0){
        int r = x % y;
        x = y;
        y = r;
    }
    return x;
}
int lcm(int x, int y)
{
    int a = x;
    int b = y;
    while(a != b){
        if(a < b){
            a += x;
        }else{
            b += y;
        }
    }
    return a;
}
int main()
{
    while(true){
        int a, b;
        std::cin >> a >> b;
        if(std::cin.eof()) break;
        std::cout << gcd(a, b) << " " << lcm(a, b) << std::endl;
    }
    return 0;
}