#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>


#define N 1024

int main()
{
	char buff[N];
	
	while (NULL != fgets(buff, N, stdin))
	{
		int a, b;
		sscanf(buff, "%ld %ld", &a, &b);
		
		int  m, n, k;
		m = a;
		n = b;
		do
		{
			k = m % n;
			m = n;
			n = k;
		} while (0 != k);
		
		printf("%d %d\n", m, a * (b / m));
	}
	return 0;
}