#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

int main(){
	int a, b;
	while(cin >> a >> b){
		cin >> a >> b;
		//find gcd
		int gcd = 0;
		for(int i = 1; i <= max(a, b); i++){
			if(a % i == 0 and b % i == 0) gcd = max(gcd, i);
		}
		//find lcm
		int idx = 0;
		int lcm = 0;
		while(!lcm){
			idx++;
			if(idx % a == 0 and idx % b == 0) lcm = idx;
		}
		cout << gcd << " " << lcm << endl;
	}
	return 0;
}

