#include <stdio.h>

#define REP(i, n) for(i=0;i<n;i++)
#define MOD_NUM (1000000007)

int main(void)
{
	int a, b;
	int gcd;
	long long int lcm;

	while ((scanf("%d %d", &a, &b)) != EOF){
		int i;

		gcd = 1;
		for (i = 2; i <= a && i <= b; i++){
			if (a % i == 0 && b % i == 0){
				gcd *= i;

				a /= i;
				b /= i;
				i--;
			}
		}
		lcm = gcd * a * b;

		printf("%d %lld\n", gcd, lcm);
	}

	return 0;
}
