#include <bits/stdc++.h>
long long gcd;

int euklides(long long a, long long b) {
    while (a % b!= 0) {
        int tmp = b;
        b = a % b;
        a = tmp;
    }
    return b;
}

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

int main()
{
    long long a, b;
    while (std::cin >> a >> b) {
        if (b > a) std::swap(a, b);
        int lc = lcm(a, b);
        std::cout << gcd <<  " " << lc << std::endl;
    }
    return 0;
}

