#include <iostream>
#include <algorithm>
using namespace std;

typedef long long ll;

int EuclidAlgo(int a,int b);

int main()
{
        ll a,b,ans1,ans2;

        while(cin >> a >> b){

                if(a < b) swap(a,b);

                ans1 = EuclidAlgo(a,b);
                ans2 = (a*b)/ans1;

                cout << ans1 << ' ' << ans2 << "\n";



        }

        return 0;

}

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