#include <stdio.h>

int gcd(int a, int b){
	int t;
	while((a % b) != 0){
		t = b;
		b = a % b;
		a = t;
	}
	return 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);
	}
}