#include <iostream>
#include <cstdlib>
#include <cmath>
#include <iomanip>
#include <stdio.h>
using namespace std;

int main(){

	double x,y;
	double a,b,c;
	bool flag;

	while(cin>>x>>y){

		flag = true;

		a=max(x,y);
		b=min(x,y);

		while(flag){

			c=abs(a-b);
			a=b;b=c;
			if(a==b)flag=false;

		}

		printf("%d %d\n",static_cast<int>(a),static_cast<int>((x*y)/a));
//		cout<<setprecision(0)<<a<<" "<<(x*y)/a;

	}

	return 0;
}