#include<bits/stdc++.h> using namespace std; int n,m; int main() { cin>>n>>m; cout<<__gcd(n,m)<<" "<<n*m/__gcd(n,m); return 0; }