#include <iostream>
using namespace std;

typedef long long int LL;

LL gcd(LL a, LL b) {
  return b != 0 ? gcd(b, a % b) : a;
}
LL lcm(LL a, LL b) {
  return a * b / gcd(a, b);
}

int main(){
	LL a, b;
	while(cin>>a>>b){
		cout<<gcd(a, b)<<" "<<lcm(a, b)<<endl;
	}
	return 0;
}