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

void main(){
  while (true){
    auto a = readln.strip.split.map!(to!long).array;
    if (a.length == 0) break;
    auto g = gcd(a[0], a[1]);
    writeln(g, " ", a[0] / g * a[1]);
  }
}