a = []
b = []
i = 0

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

while true
   ln = gets
   if ln == nil
      break
   end
   a[i], b[i] = ln.chomp.split
   a[i], b[i] = a[i].to_i, b[i].to_i
   i = i + 1
end

for j in 0..(i - 1)
   gcd = calc_gcd(a[j], b[j])
   lcm = a[j] * b[j] / gcd
   puts gcd.to_s + " " + lcm.to_s
end
