#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <algorithm>
#include <string>

using namespace std;

int euclid( int m, int n ) {
	if( n == 0 ) return m;
	return euclid( n, m % n );
}

int max( int a, int b ) {
	if( a > b ) return a;
	return b;
}

int min( int a, int b ) {
	if( a < b ) return a;
	return b;
}

int main(void){

	unsigned long long int a, b, GCD, LCM;

	while( true ) {
		if( cin.eof() ) break;
		cin >> a >> b;
		GCD = euclid( max( a, b ),min( a, b ) );
		LCM = ( a * b ) / GCD;
		cout << GCD << " " << LCM << endl;
	}

    return 0;
}