import std.stdio;
import std.string;
import std.array;
import std.conv;
import std.math;

ulong gcd(ulong a, ulong b) {
  return b > 0 ? gcd (b, a % b) : a;
}

ulong lcm(ulong a, ulong b) {
  return a * b / gcd(a, b);
}

void run(ulong a, ulong b) {
  writefln("%d %d", gcd(a, b), lcm(a, b));
}

void main() {
  ulong[][] data;

  while(true) {
    auto input = readln();
    if(stdin.eof()) break;

    auto s = split(input);
    data ~= [to!ulong(s[0]), to!ulong(s[1])];
  }

  foreach(d; data) {
    run(d[0], d[1]);
  }
}