#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <deque>
#include <algorithm>
#include <cmath>
#include <cstdio>
#define EPS 10e-6
#define rep(i, a, b) for(int i = a; i < b; i++)
using namespace std;
typedef long long ll;
int a, b;

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

int main(){
	while(cin >> a >> b){
		cout << gcd(a, b) << " " << (a/gcd(a,b))*b << endl;
	}
	
}