#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<string>
#include<map>
#include<set>
#include<vector>
#include<queue>
#include<stack>
#include<algorithm>
#include<ctime>
#define RG register
#define file(x) freopen(x".in","r",stdin);freopen(x".out","w",stdout);
using namespace std;

#define ll long long 
int main(){
	ll a,b;
	while(scanf("%lld%lld",&a,&b)!=EOF){
		printf("%lld ",__gcd(a,b));
		printf("%lld\n",1ll*a*b/__gcd(a,b));
	}
	return 0;
}

