def gcd(a,b)
  if b == 0
    a
  else
    gcd(b,a%b)
  end
end

def lcm(a,b)
  a*b/gcd(a,b)
end

def main()
  while a = gets 
    c = a.split(' ').map(&:to_i)
    print gcd(c[0],c[1])
    print ' '
    puts lcm(c[0],c[1])
  end
end

3
main()