#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<cmath>
#include<queue>
#include<stack>
using namespace std;

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

int main(){
    int A,B;
	while(cin>>A>>B){
		printf("%d %d\n",gcd(A,B),A*B/gcd(A,B));
	}
    return 0;
}