
#include <iostream>
#include <algorithm>
#include <string.h>
#include <math.h>

using namespace std;

#define pb push_back
#define mp make_pair
#define ll long long
#define ull unsigned ll
#define db double
#define INF 0x3f3f3f3f
#define MOD 1000000007
#define PII pair<int, int>

int gcd(int a,int b) {
    return b==0?a:gcd(b,a%b);
}

int a,b;

int main()
{
    while (~scanf("%d%d",&a,&b)) {
        int x=gcd(a,b);
        int y=1ll*a*b/x;
        printf("%d %d\n",x,y);
    }
}
