#include <iostream>
using namespace std;

int saidai(int a,int b){
	

	while(a !=b){
		if(a>b){
			a -=b;
		}
		else{
			b -=a;
		}
	}
	
	return a;
}

int main(){
	int a,b,c,d;
	cout<<"atai1=";
	cin>>a;
	cout<<"atai2=";
	cin>>b;

	c=saidai(a,b);
	d=a*b/c;
	cout<<c<<" "<<d;
	return 0;
}