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

long long int gcd(long long int m, long long int n) {
  return (n == 0 ? m : gcd(n, m % n));
}

long long int lcm(long long int m, long long int n) {
  return m * n / gcd(m, n);
}

int main(){
    long long int a, b;
    while(scanf("%lld %lld", &a, &b) != EOF){
        cout << gcd(a,b) << " " << lcm(a,b) << endl;
    }

    return 0;
}
