#include<iostream>
#include<cstdio>
using namespace std;
int lcm(int a,int b);
int main(){
	for(;;){
		int a,b;
		if(scanf("%d %d",&a,&b) == EOF){break;}
		int x = lcm(a,b);
		int y = a/x*b;
		cout <<x<<" "<<y<<endl;
	}
	return 0;
}
int lcm(int a,int b){
	if (a == 0){return b;}
	return lcm(b%a,a);
}