#include<stdio.h>
long long gcd(long long a,long long b){
	return b?gcd(b,a%b):a;
}
int main(void){
	long long  a,b;
	while(scanf("%lld",&a)==1&&scanf("%lld",&b)==1){
		long long temp=gcd(a,b);
		printf("%lld %lld\n",temp,a/temp*b);
	}
	return 0;
}