/*************************************************************************
    > File Name: aoj0005.cpp
    > Author:    WArobot 
    > Blog:      http://www.cnblogs.com/WArobot/ 
    > Created Time: 2017??´06???19??\ ????????? 16??¶44???39?§?
 ************************************************************************/

#include<bits/stdc++.h>
using namespace std;

#define ll long long
ll gcd(ll a,ll b){
	return b == 0 ? a : gcd(b,a%b);
}
int main(){
	ll a , b;
	while(~scanf("%lld%lld",&a,&b)){
		ll ret = gcd(a,b);
		printf("%lld %lld\n",ret,a*b/ret);
	}
	return 0;
}