#include <cstdio>
#include <cmath>

using namespace std;

int main()
{
    int a,b;

    while(scanf("%d%d",&a,&b)!=EOF){
        int gcd,lcm;

        int less=(a<b)? a:b;
        int greater=(a<b)? b:a;

        for(int i=2;i<=greater;i++){
            if((a%i==0)&&(b%i==0)) gcd=i;
        }

        for(int i=greater;i<=2000000000;i++){
            if((i%a==0)&&(i%b)==0){
                lcm=i;
                break;
            }
        }

        printf("%d %d\n",gcd,lcm);
    }

    return 0;
}