#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <cstdlib>
#include <ctime>
#include <stdio.h>

using namespace std;

int gcd(int x,int y){
	if(y==0) return x;
	gcd(y,x%y);
}

int main()
{
	unsigned long a,b,g,l;

	while(scanf("%ld%ld",&a,&b)!=EOF){
		g=gcd(a,b);
		l=a/g*b;

		cout<<g<<" "<<l<<endl;
	}

	return 0;
}