#include<iostream>
#include<stdio.h>
using namespace std;
int main(){
	long long a,b,min,x,y;
	while(cin>>a>>b){
        if(a>b){
            x=a;
            y=b;
        }else{
            x=b;
            y=a;
        }
			while(x%y!=0){
				min=x;
				x=y;
				y=min%y;
				}
			
		cout<<y<<" "<<(a*b/y)<<endl;
	}
	return 0;
}
