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