#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <math.h>
using namespace std;
 
const int MAX_N=10000;
unsigned long long int a,b;

unsigned long long gcd(unsigned long long a,unsigned long long b){
	if(b) return gcd(b,a%b);
	else return a;
}

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

int main(){
	cin >> a >> b;
	cout << gcd(a,b) << " " << lcm(a,b) << endl;
	return 0;
}