#include <stdio.h>
int gcd(int a, int b);
int main()
{
    long long a, b,g, lcd;
    while(scanf("%lld %lld",&a, &b)==2)
    {
    g =gcd(a,b);
    lcd= (a*b)/g;
    printf("%lld %lld\n", g, lcd);
    }
    return 0;
}
int gcd(int x, int y)
{
    int r;
    while(x!=0)
    {
        r=y%x;
        y=x;
        x=r;
        gcd(x,y);
    }


    return y;
}