/*
  GCD and LCM
*/
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<cmath>
#define ll long long
using namespace std;

int n,m;

int gi() {
  int x=0,o=1; char ch=getchar();
  while(ch!='-' && (ch<'0' || ch>'9')) ch=getchar();
  if(ch=='-') o=-1,ch=getchar();
  while(ch>='0' && ch<='9') x=x*10+ch-'0',ch=getchar();
  return o*x;
}

int gcd(int x, int y) {
  return y?gcd(y,x%y):x;
}

int main() {
  while(scanf("%d%d", &n, &m)!=EOF) {
    int g=gcd(n,m);
    printf("%d %d\n", g,n/g*m);
  }
  return 0;
}