#include<iostream>
#include<cstdio>
using namespace std;
long long aaa(long long a,long long b){
	while(1){
		a=a%b;
		if(a==0)break;
		swap(a,b);
	}
	return b;
}

int main(){
	long long a,b;
	while(scanf("%lld%lld",&a,&b)!=EOF){
		long long t=aaa(a,b);
		cout<<t<<" "<<a/t*b<<endl;
	}
	return 0;
}