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

function fn(a, b) {
  return Math.max(
    a - b,
    a + b,
    a * b
  );
}

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