#include <string>
#include <vector>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <map>
#include <list>
#include <set>
#include <numeric>
#include <queue>
#include <stack>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <climits>
#include <cfloat>
using namespace std;
typedef long long LL;
typedef pair<int,int> P;

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