import std.algorithm;
import std.array;
import std.stdio;
import std.string;
import std.numeric;

void main(){
    foreach(line; stdin.byLine){
        auto k = line.split.map!("to!int(a)")().array();
        int gcd = gcd(k[0], k[1]);
        writefln("%d %d", gcd, k[0] * (k[1]/gcd));
    }
}