function main(lines) {
  const lin = lines[0];
  const a = Number(lin[0].slice(0,1));
  const b = Number(lin[1].slice(-1));
  if(isNaN(a) || isNaN(b))throw new Error("nan");
  var m = a + b;
  if (a - b > m) m = a - b;
  if (a * b > m) m = a * b;
  console.log(m);
}
main(require('fs').readFileSync('/dev/stdin', 'UTF-8'));