#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;

int gcd(int a ,int b){
	if(b==0) return a;
	return gcd(b,a%b);
}

int lcm(int a,int b,int c){
    return b/c*a;
}

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

