function main(input) {
  const lines = input.split('\n');
  lines.pop();
  lines.forEach(line => {
    const splited = line.split(' ');
    console.log(fn(
      parseInt(splited[0], 10),
      parseInt(splited[1], 10)
    ));
  });
}

function fn(a, b) {
  const amount = a + b;
  if (amount % 2 === 0 ) {
    return (amount) / 2;
  }
  return 'IMPOSSIBLE'
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));
