#include<stdio.h>
#include<stdlib.h>
#include <math.h>
#include <iostream>
using namespace std;
int main()
{
    long long a,b,s,d, l, k;
    while(scanf("%lld%lld",&a,&b)!=EOF){
    s=max(a, b);
    k=min(a, b);
    while(k>0){
        if(a%k==0&&b%k==0) break; 
        else k=k-1;
    } 
    l=k;
    printf("%lld %lld", l,(a*b)/l);
    }
    return 0;
}
    