#include<stdio.h>
#include<string.h>
#include<iostream> 
#include<queue>
#include<vector> 
#include<algorithm>
#include<utility>
#include<cmath>
#define inf 0x3f3f3f3f
using namespace std;

typedef long long ll;
typedef pair<int,int> P;
ll gcd(ll a,ll b){
	ll t;
	while(b!=0){
		t=a;
		a=b;
		b=t%b;
	}
	return a;
}
int main()
{
	ll a,b;
	while(scanf("%lld%lld",&a,&b)!=EOF){
		ll Gcd=gcd(a,b);
		ll Lcm=a*b/Gcd;
		printf("%lld %lld\n",Gcd,Lcm);
	} 
    return 0;
}

