#include<iostream>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<queue>
#include<vector>
#include<stack>
#include<algorithm>
#include<set>
#include<map>
#include<deque> 
using namespace std;
#define INF 0x3f3f3f3f
typedef long long LL;
typedef pair<int,int> ppp;

LL a,b;
LL gcd(LL x,LL y){
	return y==0?x:gcd(y,x%y);
}
int main(){
	while (scanf("%lld%lld",&a,&b)){
		LL G = gcd(a,b);
		unsigned long long L = (a/G)*(b/G)*G; 
		printf("%lld %llu\n",G,L);
	}
	return 0;
}