#include<stdio.h>


int Kouyakusu(int a,int d){

	if((a==0)||(d==0))
		return 0;
	

	while(a != d){

		if(a > d)
			a-=d;
		else
			d-=a;
	}

	return a;

}

int main(void){

	long int a,b;

	long int yaku;

	for(int i=0;i<2;i++){
	scanf("%d %d",&a,&b);

	yaku = Kouyakusu(a,b);

	if(yaku != 0)
		printf("%d %d\n",yaku, (a/yaku)*b);
	else
		printf("0 0\n");

	}
	return 0;

}