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