// -*- coding:utf-8; tab-width:4 -*-
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <complex>
#include <functional>
#include <iterator>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>

// 解答
namespace solution {
    using namespace std;
   
    typedef istringstream ISS;
    typedef ostringstream OSS;
    typedef vector<string> VS;
    typedef long long LL;
    typedef int INT;
    typedef vector<INT> VI;
    typedef vector<VI> VVI;
    typedef pair<INT, INT> II;

    LL a, b;

    template <class T> T gcd( T a, T b ) {
        T i, j;
        for ( i = 0; ! ( a & 1 ); ++ i )
            a >>= 1;
        for ( j = 0; ! ( b & 1 ); ++ j )
            b >>= 1;
        while ( b != a ) {
            b -= a;
            if ( b < 0 ) {
                a += b;
                b = -b;
            }
            while ( ! ( b & 1 ) )
                b >>= 1;
        }
        return a << min( i, j );
    }

    template <class T> T lcm( T a, T b ) {
        T larger = a > b ? a : b;
        T smaller = a > b ? b : a;
        T res = larger;
        while ( res % smaller != 0 )
            res += larger;
        return res;
    }

    struct Solution {
        void init() {
        }
   
        bool input() {
            return cin >> a >> b;
        }

        void solve() {
            cout << gcd(a,b) << " " << lcm(a,b) << endl;
        }
      
        int run() {
            while ( init(), input() ) {
                solve();
            }
            return 0;
        }
    };
}

int main() {
    return solution::Solution().run();
}