#include <iostream>
#include <cstdio>
using namespace std;

int gcd (int a, int b)
{
    if (b == 0){
        return (b);
    }
    else {
        gcd(b, a % b);
    }
}
int lcm(int a, int b)
{
    while (1){
        int i = 2;
        if (a % i == 0 && b % i == 0){
            return (i);
            break;
        }
        i++;
    }
}

int main()
{
    int a, b;

    cin >> a;
    cin >> b;
  
 

    cout << gcd(a, b) << " " << lcm(a, b) << endl;
    return (0);
}