#include <iostream>
using namespace std;

int saidai(int a,int b){
	while(a !=b){
		if(a>b){
			a -=b;
		}
		else{
			b -=a;
		}
	}
	return a;
}
int saisyou(int a,int b){
	return a*b/saidai(a,b);
}

int main(){
	int a,b,c,d;
	cin>>a; cin>>b;
	c=saidai(a,b);
	d=saisyou(a,b);
	cout<<c<<" "<<d;
	return 0;
}