#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <cstring>
#include <climits>
#include <cmath>
#include <cfloat>

#define FOR(i,b,n) for(int i=b;i<n;i++)
#define CLR(mat) memset(mat, 0, sizeof(mat))
#define INF 1<<25

using namespace std;


int gcd(int a, int b)
{
	return ( b > 0 )? gcd(b, a%b) : a ;
}

int lcm(int a, int b)
{
	return ( a / gcd(a, b) * b);
}

int a, b;

int main()
{
	while( cin >> a >> b, !cin.eof())
	{
		cout << gcd(a,b) <<" "<< lcm(a,b) << endl;
	}

	return 0;
}