#include<stdio.h>
#include<iostream>
#include<string>
#include<cstdlib>

using namespace std;

int main()
{
	int  a, b,a1,b1,c,g;
	long l;
	cin >> a>>b;
	a1 = a;
	b1 = b;
	
		while (1)
		{
			c = abs(a - b);
			if (c == 0)
			{
				break;
			}

			if (a > b)
			{
				a = c;
				g = c;
			}
			else if (a<b)
			{
				b = c;
				g = c;
			}
		}
		l = (a1/g)*b1;
		cout << g << " " << l;
}