#include <iostream>
#include <cstdio>
using namespace std;

int gcd(int a, int b) {

	for (int i = a; i >= 1; i--)
		if(a % i == 0)
			if(b % i == 0)
				return i;



int main(void){
    int a, b;
    while(cin >> a >> b) {
      int lcm = a / gcd(a,b) * b;
      cout << gcd(a,b) << " " << lcm << endl;
    }
    return 0;
}
