#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <bitset>
#include <cmath>
#include <queue>
#include <stack>
using namespace std;
long long gcd(long long a,long long b)
{
	if(b==0)   return a;
	return gcd(b,a%b);
}
long long n,m;
int main()
{
    while(cin>>n>>m)
	{
		cout<<gcd(n,m)<<" "<<n*m/gcd(n,m)<<endl;
	}
    return 0;
}