/********************************************************************
 * ??£?????´??° a,b ?????\?????????a ??¨ b ????????§??¬?´???°??¨????°???¬?????°???????????????
 * ????????°?????????????????????????????????
 ********************************************************************/
#include <iostream>
#include <cstring>
typedef struct _input_values {
    int a;
    int b;
} INPUT_VALUES;

typedef struct _input_values_list {
    INPUT_VALUES sList[10000];
    int effectCount;
} INPUT_VALUES_LIST;

int gcd( int a, int b );    // ?????§??¬?´???°????±???????
int lcm( int a, int b, int g );    // ????°???¬?????°????±???????

using namespace std;

int main()
{
    int i = 0;
    int tA = 0, tB = 0;
    int g = 0, l = 0;
    INPUT_VALUES_LIST values;

    memset( &values, 0, sizeof(values) );

    while( cin >> tA >> tB ) {
        values.sList[values.effectCount].a = tA;
        values.sList[values.effectCount].b = tB;
        values.effectCount++;
    }

    for ( i = 0; i < values.effectCount; i++ ) {
        g = gcd( values.sList[i].a, values.sList[i].b );
        l = lcm( values.sList[i].a, values.sList[i].b, g );
        cout << g << " " << l << endl;
    }

    return 0;
}

/*  @brief  ?????§??¬?´???°????±???????
 *  @param  [i] a   ???????????????
 *  @param  [i] b   ???????????????
 *  @retval ?????§??¬?´???°
 */
int gcd( int a, int b )
{
    int ret = 0;

    if ( 0 == a || 0 == b ) {
        return 0;
    }

    if ( a != b ) {
        if ( a > b ) {
            a = a - b;
        } else {
            b = b - a;
        }
    } else {
        return a;
    }

    ret = gcd( a, b );

    return ret;
}

/*  @brief  ????°???¬?????°????±???????
 *  @param  [i] ???????????????
 *  @param  [i] ???????????????
 *  @param  [i] ?????§??¬?´???°
 *  @retval ????°???¬?????°
 */
int lcm( int a, int b, int g )
{
    if ( 0 == a || 0 == b ) {
        return 0;
    }

    return ( a * b / g );
}