#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <cmath>
using namespace std;
typedef vector<int> VI;
#define REP( i, m, n ) for ( int i = (int)( m ); i < (int)( n ); ++i )

template<typename T>
T gcd(T m, T n) {
    return n == 0 ? m : gcd(n, m % n);
}

template<typename T>
T lcm(T m, T n) {
    return (m * n) / gcd(m, n);
}

int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    
    vector<pair<long, long>> pairs;
    long ta, tb;
    while (cin >> ta >> tb) {
        pair<long, long> tmp;
        tmp.first = ta;
        tmp.second = tb;
        pairs.push_back(tmp);
    }
    
    for (auto p : pairs) {
        cout << gcd(p.first, p.second) << " " << lcm(p.first, p.second) << endl;
    }
    
    return 0;
}