Problem:
Score: 100 points

Problem Statement

We have two distinct integers A and B.

Print the integer K such that |A - K| = |B - K|.

If such an integer does not exist, print IMPOSSIBLE instead.

Constraints

All values in input are integers.

0 \leq A,\ B \leq 10^9

A and B are distinct.

Input

Input is given from Standard Input in the following format:

A B

Output

Print the integer K satisfying the condition.

If such an integer does not exist, print IMPOSSIBLE instead.

Sample Input 1

2 16

Sample Output 1

9

|2 - 9| = 7 and |16 - 9| = 7, so 9 satisfies the condition.

Sample Input 2

0 3

Sample Output 2

IMPOSSIBLE

No integer satisfies the condition.

Sample Input 3

998244353 99824435

Sample Output 3

549034394

Solution in JavaScript (node.js v5.12) (judge verdict: Wrong Answer)

"use strict"

const arg_str = require('fs').readFileSync('/dev/stdin', 'UTF-8')
const args= arg_str.split(' ')
const arg_1 = parseInt(args[0])
const arg_2 = parseInt(args[1])

const sum = arg_1 + arg_2
const div = Math.floor(sum / 2)
const mod = sum % 2

const IMPOSSIBLE = "IMPOSSIBLE"

if(mod != 0){
  console.log(IMPOSSIBLE)
  return
}

let return_val1 = 0
if(arg_1 < div){
  return_val1 = div - arg_1
}else{
  return_val1 = arg_1 - div
}

let return_val2 = 0
if(arg_2 < div){
  return_val2 = div - arg_2
}else{
  return_val2 = arg_2 - div
}

if(return_val1 == return_val2){
  console.log(`${return_val1}`)
}else{
  console.log(IMPOSSIBLE)
}