#include <iostream>
int gcd(int a , int b){
    return (b == 0)? a : gcd(b , a % b);
}
int main(){
    int a , b;
    while(std::cin >> a >> b){
        int x = gcd(a , b);
        std::cout << x << " " << x * (int)(a / x) * (int)(b / x) << "\n";
    }
}
