#include <iostream>

int gcd(int a, int b) {
    if (b == 0) {
        return a;
    }
    return gcd(b, a % b);
}

int main(void) {
    int a;
    int b;
    int g;
    while (std::cin >> a >> b) {
        g = gcd(a, b); 
        std::cout << g << std::endl; 
        std::cout << (int)((double)a / (double) g * (double)b) << std::endl;
    }
    return 0;
}