#include <iostream>
#include <cmath>
#include <algorithm>
#include <string>
#include <stdio.h>
using namespace std;
int gcd(int x,int y){
    if(x<y)swap(x,y);
    int r=1;
    while (r) {
        r=x%y;
        x=y;
        y=r;
    }
    return x;
    
}
int main() {
    int a,b;
    while (cin >> a >> b) {
        cout << gcd(a,b)<< " "<< (long long) a*b/gcd(a, b)<<endl;
    }
}
