#include<iostream>
using namespace std;


int main()
{
	int a, b;
	while(cin>>a>>b)
	{
		int i = a;
		while (a%i != 0 || b % i != 0)
			i--;
		int j = a;
		while (j%a != 0 || j % b != 0)
			j++;
		cout << i << " " << j << endl;
	}
    return 0;
}

