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

int gcd(int u, int v) {
  int r;
  while (0 != v) {
    r = u % v; u = v; v = r; /* swap */
  }
  return u;
}

int main(){
	int a,b,x;
	cin>>a>>b;
	cout<<gcd(a,b)<<" ";
	x=a*b;
	if(a<b){
		int tmp = a;
		a = b;
		b = tmp;
	}
	cout<<x/gcd(a,b)<<endl;

    return 0;
}