/*
P135
AOJ 0005 GCD and LCM
*/

#include <iostream>
#include <map>
#include <set>
#include <algorithm>
#include <cstdio>
#include <queue>
#include <functional>
#include <string.h>
#include <cmath>

using namespace std;

int gcd(int a, int b)
{
    while(b){
        int c = a % b;
        a = b;
        b = c;
    }
    return a;
}

int main()
{
    int a, b;
    long long mul;
    while(cin>>a>>b){
        mul = a * (long long)b;
        int g = gcd(a, b);
        cout << g << " " << mul / g << endl;
    }
}