#include<iostream>
#include<cstdio>
using namespace std;

long long gcd(long long x,long long y){
	return (y==0?x:gcd(y,x%y));
}

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