import std.stdio;
import std.array;
import std.conv;

int gcd(int x, int y) {
    if(x < y) {
        int t = x;
        x = y;
        y = t;
    }
    if(y == 0) {
        return x;
    }
    return gcd(y, x % y);
}

void main() {
    int a, b;
    while(true) {
        string[] input = split(readln());
        if(input.length == 0) break;
        a = to!int(input[0]);
        b = to!int(input[1]);
        int gcd_ab = gcd(a, b);
        int lcm_ab = a / gcd_ab * b;
        writeln(gcd_ab, " ", lcm_ab);
    }
}