#include
using namespace std; int main() { int a, b; int f = 0; int c[10000]; cin >> a >> b; for (int i = 1;i <= a + b;i++) { if (a % i == 0 && b % i == 0) c[i] = i; } for (int i = 1;i <= a + b;i++) { if (c[i] > f) { f = c[i]; } } //cout << f;//最大公约数 long d; for (long i = 1;i <= a * b;i++) { if (i % a == 0 && i % b == 0) { d = i; break; } }
cout << f << " " << d << endl;//最小公倍数
}