#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
using namespace std;
static const double EPS = 1e-5;

int GetGCD(int m, int n){
	if(n == 0){
		return m;
	}

	return GetGCD(n, m%n);
}

int GetLCM(int a, int b, int gcd){
	return (int)((double)a/gcd*b);
}

int main(){
	int a, b;
	int g, l;

	while(cin >> a >> b){

		if(a > b){
			g = GetGCD(a, b);
		}else{
			g = GetGCD(b, a);
		}

		l = GetLCM(a, b, g);
		cout << g << ' ' << l << endl;
	}

	return 0;
}