#include <iostream>
#include <algorithm>
#include <cstdio>
#include <string>
#include <sstream>
#include <cstdlib>
#include <cmath>
 
using namespace std;

int GCD(int max, int min){
    if(max % min == 0) { return min; }
    else return GCD(min, max % min);
}
 
int main(){
    long long int a, b;
    while(cin >> a >> b){
        long long int gcd = GCD(max(a, b), min(a, b));
        long long int lcm = a * b / gcd;
        cout << GCD(max(a, b), min(a, b)) << " " << lcm << endl;
    }
    return 0;
}