#include <iostream>


using namespace std;

int main(){
	
	int ii = 1;
	int a;
	int b;
	while (1){
		
		cin >> a >> b;
	for (int i = 0; i <= 2000000001; i++){
		
		
		int c = ii / a * a;
		int d = ii / b * b;
		if (ii == c&&ii == d){
			cout << a * b / ii <<  " " <<ii<< endl;
			break;
		}
		else ii++;

}
	}
	
	return 0;
}