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

int main(){
	long a,b,m,n,tmp;
	
	while(cin>>a>>b){
		if(a>=b){
			m=a;
			n=b;
		}else{
			m=b;
			n=a;
		}
		
		for(;n!=0;){
			tmp=n;
			n=m%n;
			m=tmp;
		}
		
		cout<<m<<" "<<a*b/m<<endl;
	}
	return 0;
}