#include <iostream>
#include <cstdio>
using namespace std;
#define REP0(i,n) for(int i=0;i<n;++i)
#define REP1(i,n) for(int i=1;i<=n;++i)
#define ALL(c) (c).begin(),(c).end()
typedef long long ll;
ll gcd(ll a,ll b){
	while(b>0){
		if(a>b) swap(a,b);
		b%=a;
	}
	return a;
}
int main(){
	ll a,b;
	while(scanf("%lld%lld",&a,&b)!=EOF) printf("%lld %lld\n",gcd(a,b),a/gcd(a,b)*b);
	return 0;
}