#include <iostream>
#include <stdio.h>

int GCD(int A, int B) {
    if (B == 0) return A;
    
    return GCD(B, A % B);
}

int main() {
    int a, b;
    
    while (std::cin >> a && std::cin >> b) {
        int gcd = GCD(a, b);
        printf("%d %d\n", gcd, a/gcd*b);
    }
    
    return 0;
}

