#include<iostream>
#include<cstdio>
#include<vector>
#include <algorithm>
#include <functional>
#include<cmath>
#include<numeric>

#define lcm(a, b, c) (a*b)/c

using namespace std;

int gcd(int max , int min){
int amari;
while(1)
{
amari=max%min;
if(amari==0) return min;
max=min;
min=amari;
}
}

int main(){
	int a,b;
	while(cin>>a>>b)
	{
		int saidai,saisyou;
		long long int kari=0;
		saidai = gcd( max(a,b) , min(a,b) );
		kari = b/saidai;
		saisyou =kari*a;

		cout<<saidai<<" "<<saisyou<<endl;
	}

	return 0;
}