#include <algorithm>
#include <math.h>
#include <iostream>
using namespace std;
int gcd(int a, int b) {
if (b == 0) return a;
return gcd(b, a % b);
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL);
int a, b;
cin >> a >> b;
if (a < b) swap(a, b);
int g = gcd(a, b);
int l = a * b / g;
cout << g << "\n" << l;
return 0;
}