#include<iostream>

using namespace std;

int main(){
    long a, b;
    cin>> a >> b;
    long A=a, B=b;
    while (a!=b)
    {
        if (a > b){
            a = a - b;
        }
        else{
            b = b - a;
        }
    }
    long gcd = A / a*B;
    cout << a << " " << gcd;

    return 0;
}