#include <stdio.h>
#include <stdlib.h>
	
int gcd(int a, int b){
	int c;
	if (a < b) {
		a+=b; b=a-b; a-=b;
	}
	while (b != 0) {
		c = a % b;
		a = b;
		b = c;
	}
	return a;
}
int lcm(int x, int y)
{
    return (x * y / gcd(x, y));
}


int main(void)
{
	int a, b;
	scanf("%d %d", &a, &b);
	printf("%d %d\n", gcd(a, b),lcm(a,b));
	return 0;
	
}