#include<stdio.h>
int main(){
	int a,b,j,x,y;
	while(scanf("%d%d",&a,&b)!=EOF){
		int i;
		if(a>b){i=a;a=b;b=i;}x=a;y=b;
		while(b-a){
			b=b-a;
			if(a>b){i=a;a=b;b=i;}}
		j=(x/b)*(y/b)*b;
		printf("%d %d\n",b,j);}
	return 0;}
