import std.stdio;
import std.ascii;
import std.range;
import std.array;
import std.functional;
import std.algorithm;
import std.conv;
import std.container;
import std.math;
import std.numeric;
import std.string;
import std.c.string;
import std.random;
import std.regex;
import std.typecons;

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

void main() {
    while (true) {
        long n, m;
        scanf("%lld %lld\n", &n, &m);
        writeln(gcd(n, m), " ", lcm(n, m));
        if (stdin.eof) break;
    }
}