#include<iostream>
#include<cmath>
using namespace std;
int f1(int m,int n);
int f2(int m,int n);
int main()
{
	int a,b,small,big,y=0,x=0;
	cin>>a>>b;
	if(a>b)
	{
		small=b;
		big=a;
	}
	else
	{
		small=a;
		big=b;	
	}
	y=f1(small,big);
	x=f2(small,big);
	cout<<y<<" "<<x;
	
	return 0;
}

int f1(int m,int n)
{
	int y=0;
	for(int i=m;i>0;i--)
	{
		if(m%i==0&&n%i==0)
		{
			y=i;
			break;
		}
			
	}
	
	return y;
}

int f2(int m,int n)
{
	int x=0;
	for(int i=n;i>0;i++)
	{
		if(i%m==0&&i%n==0)
		{
			x=i;
			break;
		}
			
	}
	
		return x;
}

