#include<stdio.h>
#include<algorithm>
using namespace std;
int gcd(int m ,int n){
	if(n==0) return m;
	else return(n,m%n);
}

int main(){
         long int a ,b ,g ,l;
		 while(scanf("%ld %ld",&a,&b)!=EOF){
			g = gcd(a,b);
			l = a/g*b;
			printf("%ld %ld\n",g,l);
		 }
		 return 0;
}