let input = ''

process.stdin.resume()
process.stdin.setEncoding('utf8')
process.stdin.on('data', function(chunk) {
  input += chunk
})
process.stdin.on('end', function() {
  input = input.trim().split('\n')
  main()
})

function main() {
    for(i=0; i<input.length; i++) {
        input_line = input[i].split(' ')
        input_line.sort(compareNumbers)
        let a = input_line[0]
        let b = input_line[1]
        let r = input_line[0] % input_line[1]
        let x = a * b
        while(r!=0){
          a = b
          b = r
          r = a % b
        }
        console.log(b, x/b)
    }
}

function compareNumbers(a, b) {
  return b - a;
}
