#include <cstdio>
#include <iostream>

using namespace std;

int main(){
    int n, m, a, b, i=2, j=2, g;
    cin >> n >> m;
    
    a=n;b=m;
    while(a!=b){
        if(a<b) a=n*i++;
        else b=m*j++;
    }
    
    g = n*((double)m/a);
    printf("%d %d\n",g,a);
}