#include <iostream>
#include <vector>
#include <cassert>
#include <algorithm>
#include <functional>
#include <cmath>
#include <iomanip>
#include <limits>
#include <bits/stdc++.h>
using namespace std;
long long x,y;
int gcd(int x,int y){
    if(y==0){
        return x;
    }else{
        return gcd(y,x%y);
    }
    
}
int main(){
    while(cin >> x >> y){
        cout << gcd(x,y) << " "<< x*y/gcd(x,y) <<endl;

    }
        
}

