#include<bits/stdc++.h>
using namespace std;

int64_t gcd(int64_t a,int64_t b){
	if(a%b==0)return b;
	return gcd(b,a%b);
}

int main(){
	cin.tie(0),ios::sync_with_stdio(false);
	int a,b;
	while(cin>>a>>b){
		int64_t g=gcd(a,b);
		cout<<g<<" "s<<a/g*b<<"\n"s;
	}
}
