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