#include <string>
#include <vector>
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<sstream>
#include<functional>
#include<map>
#include<set>
#include<cmath>

using namespace std;


    long long g(int a,int b){

	int r=max(a,b)%min(a,b);
	if(r==0)  return min(a,b);
	else return g(min(a,b),r);
}

int main(){

	long long a,b;
	cin >> a >> b;

	cout << g(a,b) << " " << (a*b)/g(a,b) << endl;


	return 0;
}