def gcd(m, n)
    if ((0 == m) || (0 == n))
        return 0;
    end
    while m != n
        if m > n
            m = m - n
        else
            n = n - m
        end
    end
    return m
end

def lcm(m, n)
    if (0 == m) || (0 == n)
        return 0
    end
    return ((m / gcd(m, n)) * n)
end

while line = gets
    a,b = line.split.map(&:to_i)
    printf("%d %d\n", gcd(a, b), lcm(a, b))
end