#include <iostream>
#include <vector>
#include <bitset>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <map>
#include <set>
#include <utility>
#include <algorithm>
#include <stack>
#include <queue>
#include <stdio.h>
#include <limits.h>
#include <string.h>

using namespace std;
/*
 greatest common division
 
 8 6 
 
 8%6 2
 
 */
int calcGCD(int a, int b){
    if(b == 0) return a; 
    else return calcGCD(b%a, a%b);
}

int calcLCM(int a, int b){
    int t = calcGCD(a, b);
    //cout<<t<<endl;
    if(t != 0) return (a / t * b);
    else return 0;
}

int main(){
    int n,m;
    while(cin>>n>>m){
        cout<<calcGCD(n,m)<<" "<<calcLCM(n,m)<<endl;
    }
}