#include <iostream>
#include <algorithm>
#define ll long long
using namespace std;

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

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    
    ll a, b;
    while(cin >> a >> b)
    {
        if(a < b) swap(a, b);
        ll g, l;
        g = gcd(a, b);
        l = (a*b)/gcd(a, b);
        cout << g << " " <<  l << "\n";
    }
    return 0 ;
}

