#include <cstdio>
int gcd(int a,int b) {
	return b?gcd(b,a%b):a;
}
int lcm(int a,int b,int gcd) {
	return a/gcd*b;
}
int main() {
	int a,b,g;
	while(scanf("%d %d",&a,&b)!=EOF) {
		g=gcd(a,b);
		printf("%d %d\n",g,lcm(a,b,g));
	}
}