#include <iostream>
using namespace std;

int main(){
		long long a, b, m, n, r;
		while(cin >> a >> b){
				if(a == b){
						cout << a << " " << a << endl;
				}
				else if(a > b){
						m = a;
						n = b;
						while(r = m % n){
								m = n;
								n = r;
						}
						cout << n << " " << (a * b) / n << endl;
				}
				else if(a < b){
						m = b;
						n = a;
						while(r = m % n){
								m = n;
								n = r;
						}
						cout << n << " " << (a * b) / n << endl;
				}
		}
		return 0;
}