#include <iostream>
#include <stdio.h>
using namespace std;


int main(){


    long long a,b,c=12,temp,p;
    while (scanf("%lld %lld",&a,&b)!=EOF)
    {
        c=12;

    if(a > b)
    {
        temp = a;
        a = b;
        b = temp;
    }
    p = a*b;
    while(c != 0)
    {
       c = a%b;
       a = b;
       b = c;
    }

    printf("%lld ",a);
    printf("%lld\n",p/a);
    }
    return 0;
}

