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