#include <bits/stdc++.h>
using namespace std;
int gcd(int a,int b){if(a%b==0)return b;return gcd(b,a%b);}
int lcm(int a,int b){int c=gcd(a,b);return ((a/c)*(b/c)*c);}
int main(){
	int a,b;
	while(scanf("%d %d",&a,&b)!=EOF){
		cout << gcd(a,b) << " " << lcm(a,b) << endl;
	}
}
