#include <iostream>
using namespace std;

int main(int argc, char *argv[]){
    int a,b,r;
	while(cin>>a>>b){
		int a0=a,b0=b;
		r=a%b;
		while(r!=0){
			a=b;
			b=r;
			r=a%b;
		}
	    
		cout <<b<<" "<< a0*(b0/b) << endl;
	}
    return 0;
}