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

int GCD(int a, int b) { return (a % b ? GCD(b, a % b) : b); }
int LCM(int a, int b) { return ((a / GCD(a, b)) * b); }

int main()
{
  int a, b;
  while (scanf("%d %d", &a, &b) != EOF) {
    cout << GCD(a, b) << " " << LCM(a, b) << endl;
  }
}

