#include<iostream>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
#include <sstream>
typedef long long ll;
ll a,b,c,d;

ll gcd(ll a,ll b){
	c=1;
	while(c>0){
		if(a<b){switch(a,b);}
		c=a%b;
		a=b;
		b=c;
	}
	return a;
}
ll lcm(ll a,ll b){
    d=a*b/gcd(a,b);
	return d;
}

int main(){
int f,i;
while(cin>>a>>b){
	f=gcd(a,b);
	i=lcm(a,b);
	cout<<f<<" "<<i<<endl;
}
}