def gcd(a,b)
      if b==0
            a
      else
            gcd(b,a%b)
end
def lcm(a,b){a * b / gcd(a,b)}
while line = gets
      a,b = line.split.map(&:to_i)
      print gcd(a,b)," ",lcm(a,b),"\n"
end