#include <stdio.h>

int gcd(int a, int b){
	if(a % b == 0) return b;
	else return gcd(a, a % b);
}

int main(){
	int a,b;
	int t;
	while(scanf("%d%d", &a, &b) != EOF){
		t = gcd(a,b);
		printf("%d %d\n", t, a/t*b);
	}
}