#include<iostream>
using namespace std;


int main(){

	int a, b;

	while(cin >> a >> b){

		long m = ( a>=b ? a : b );
		long n = ( a>=b ? b : a );

		while( n != 0 ){
			int temp = n;
			n = m % n;
			m = temp;
		}

		cout << m << " " << a / m * b  << endl;

	}

	return 0;
}