#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <cassert>
#include <iostream>
#include <iomanip>
#include <string>
#include <sstream>
#include <algorithm>
#include <utility>
#include <iterator>
#include <limits>
#include <bitset>
#include <set>
#include <map>
#include <vector>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#define endl '\n'
#define INF (214748347/2)
#define LL long long
#define PII pair<int, int>
using namespace std;
const int MAXN = 40;

int gcd(int a, int b) {
    if (b == 0) return a;
    return gcd(b, a % b);
}

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
    // freopen("in.txt", "r", stdin);
    // freopen("out.txt", "w", stdout);
    int a, b;
    while (cin >> a >> b) {
        int g = gcd(a, b);
        cout << g << " " << a / g * b << "\n";
    }
}

