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

int gcd(int a, int b)
{
  int c;
  while (a != 0){
    c = a;
    a = b % a;
    b = c;
  }
  return (b);
}

int lcm(int a, int b)
{
  if (a == 0 || b == 0) return (0);
  return ((a / gcd(a, b)) * b);
}

int main()
{
  int a, b;
  cin >> a >> b;
  cout << gcd(a, b) << " " << lcm(a, b) << endl;
}