	#include<iostream>
	using namespace std;

	long gcd(long a,long b)
	{
		if(b == 0)return a;
		gcd(b,a % b);
	}

	int main(){

		long long  a,b,g,l;
		while(cin>>a>>b)
		{
			g = gcd(a,b);
			l = a * b /g;
			cout<<g<<" "<<l<<endl;	
		}		
		return 0;
	}