#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<iomanip>
using namespace std;

int main(){
	long a, b, r, g, l, x, y;

	while(1){
		cin >> a >> b;

		if(cin.eof()){
			break;
		}

		x = a;
		y = b;
		
		if(x < y){
			swap(x, y);
		}

		while(y > 0){
			r = x % y;
			x = y;
			y = r;
		}

		g = x;
		l = (a / g) * b;

		cout << g << " ";
		cout << l << endl;
	}

	return 0;
}