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-----
2 16

-----Sample Output-----
9

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

Difficulty: introductory

Starter code:

Solutions:
A, B = map(int, input().split())
 
if (A+B) %2 == 0: print((A+B) // 2)
else: print('IMPOSSIBLE')

import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    A, B = LI()

    if (A - B) % 2 == 0:
        print(((A + B) // 2))
    else:
        print('IMPOSSIBLE')

def __starting_point():
    resolve()

__starting_point()

A,B=map(int,input().split())
K=(A**2-B**2)/(2*(A-B))
if K%1==0:
  print(int(K))
else:
  print('IMPOSSIBLE')

A,B=map(int,input().split())
print((A+B)//2) if (A+B)%2==0 else print('IMPOSSIBLE')

A,B=map(int,input().split())
print((A+B)//2 if (A+B)%2==0 else "IMPOSSIBLE")

# A
a, b = map(int,input().split())
k=max(a,b)-(max(a,b)-min(a,b))/2
if k.is_integer():
    print(int(k))
else:
    print("IMPOSSIBLE")

A, B = map(int, input().split())

if (A + B) % 2 == 0:
    print(int((A + B) / 2))
else:
    print('IMPOSSIBLE')

a = list(map(int,input().split()))
A = a[0]
B = a[1]

if (A+B) % 2 == 0:
    print(((A+B)//2))
else:
    print('IMPOSSIBLE')


a,b = map(int,input().split())
print("IMPOSSIBLE" if a%2 != b%2 else (a+b)//2)

a,b=map(int, input().split())

if (a+b)%2==0:
    print((a+b)//2)
else:
    print("IMPOSSIBLE")

a, b = map(int, input().split())
if a % 2 == 0 and b % 2 == 1:
    print('IMPOSSIBLE')
elif a % 2 == 1 and b % 2 == 0:
    print('IMPOSSIBLE')
else:
    print((a+b)//2)

a, b = map(int, input().split())
if abs(a-b) % 2 == 0:
    print((a+b)//2)
else:
    print("IMPOSSIBLE")

a, b = map(int, input().split())
k = (a * a - b * b) / (2 * a - 2 * b)
if k == int(k):
    print(int(k))
else:
    print('IMPOSSIBLE')

A, B = map(int, input().split())

if (A - B) % 2 != 0:
    K = 'IMPOSSIBLE'
else:
    K = (A + B) // 2

print(K)

a,b = map(int,input().split())
k = (a + b)//2
if a + b == 2 * k:
    print(k)
else:
    print('IMPOSSIBLE')

a, b = list(map(int, input().split()))

if a == - b :
    print('IMPOSSIBLE')
elif (a+b)//2 != (a+b)/2:
    print('IMPOSSIBLE')
else:
    print(((a+b)//2))


A,B = map(int,input().split())

if (A + B) % 2 == 0:
    print((A+B) // 2)
else:
    print("IMPOSSIBLE")

a, b = list(map(int, input().split( )))
s = a + b
if s %2 ==1:
  print('IMPOSSIBLE')
else:
  print((s//2))


a,b = [int(v) for v in input().split()]
if abs(a-b) % 2 == 0:
    print((int((max(a,b)+min(a,b))/2)))
else:
    print("IMPOSSIBLE")


a,b=map(int,input().split())

if (a+b)%2==0:
    print(int((a+b)/2))
else :
    print('IMPOSSIBLE')

A,B=map(int,input().split())
if A>B:
  if (A-B)%2==0:
    print(B+(A-B)//2)
  else:
    print("IMPOSSIBLE")
else:
  if (B-A)%2==0:
    print(A+(B-A)//2)
  else:
    print("IMPOSSIBLE")

def resolve():
    a,b = map(int,input().split())
    if a%2 != b%2:
        print('IMPOSSIBLE')
    else:
        print((a+b)//2)
resolve()

a,b=map(int,input().split())
if (a+b)%2==0:
    print((a+b)//2)
else:
    print("IMPOSSIBLE")

A, B = map(int, input().split())

if (A+B)%2 != 0:
    print("IMPOSSIBLE")
else:
    K = int((A+B)/2)
    print(K)

a, b = list(map(int, input().split()))
# a - k = -b + k or b - k
# a + b == 2k or a - b = 0
if a == b:
    print((0))
elif (a + b) % 2 == 0:
    print(((a + b) // 2))
else:
    print("IMPOSSIBLE")


a,b= map(int,input().split())
if (b+a)%2==0:
  print((a+b)//2)
else:
  print("IMPOSSIBLE")

A, B = map(int, input().split())
print((A + B) // 2 if (A + B) % 2 == 0 else "IMPOSSIBLE")

A, B = map(int, input().split())
print ("IMPOSSIBLE" if (A+B) % 2 > 0 else (A+B)//2)

a, b = list(map(int,input().split()))
if (a + b) % 2 == 0:
  print(((a + b)//2))
else:
  print('IMPOSSIBLE')


a,b=map(int, input().split())
print(abs(min(a,b)+abs(a-b)//2) if (a-b)%2==0 else "IMPOSSIBLE")

a,b=map(int,input().split())
if (b-a)/2%1==0:
    s=a+(b-a)//2
else:
    s="IMPOSSIBLE"
print(s)

A,B=map(int,input().split(' '))
if (A+B)%2!=0:
    print("IMPOSSIBLE")
else:
    print((A+B)//2)

a,b=list(map(int, input().split()))
print(((a+b)//2 if (a+b)%2==0 else 'IMPOSSIBLE'))


a,b=map(int,input().split())
if (a+b)%2==0:
  print((a+b)//2)
else:
  print("IMPOSSIBLE")

A,B = map(int,input().split())

if A%2 != B%2:
    print('IMPOSSIBLE')
else:
    print(int(abs(A+B)/2))

A,B=list(map(int,input().split()))
if abs(A-B)%2==0:
    print(((A+B)//2))
else:
    print("IMPOSSIBLE")


a,b = map(int,input().split())
print((a+b)//2 if (a+b)%2==0 else "IMPOSSIBLE")

a, b = map(int, input().split())
print((a + b) // 2 if (a + b) % 2  == 0 else 'IMPOSSIBLE')

A, B = map(int, input().split())
K = A+B
if K%2:
    print('IMPOSSIBLE')
else:
    print(K//2)

A,B=map(int,input().split())

if (A+B)%2==0:
    print(int((A+B)/2))
else:
    print("IMPOSSIBLE")

A, B = list(map(int, input().split()))
K = A + B

if K%2 == 0:
  print((K//2))
else:
  print("IMPOSSIBLE")


a,b=map(int,input().split())
if (a+b)%2==0:
  print((a+b)//2)
else:
  print("IMPOSSIBLE")

A, B = list(map(int, input().split()))
if A > B:
    A, B = B, A
diff = B - A
if diff % 2:
    print("IMPOSSIBLE")
else:
    print((A + diff // 2))



A, B = map(int, input().split())

if (A + B) & 1 == 1:
    print('IMPOSSIBLE')
else:
    print((A + B) // 2)

a,b=map(int,input().split())
ans=(a+b)//2
if a%2!=b%2:
  ans='IMPOSSIBLE'
print(ans)

a,b = map(int,input().split())
if (a+b) % 2 == 0:
  print((a+b)//2)
else:
  print('IMPOSSIBLE')

a,b = map(int,input().split())
if (a - b) % 2 == 0:
    print(int((a+b)/2))
else:
    print('IMPOSSIBLE')

a, b = list(map(int, input().split()))

if (a+b) % 2 == 0:
    print((int((a+b)//2)))
else:
    print("IMPOSSIBLE")


a, b = list(map(int, input().split()))
c = (max(a, b)-min(a, b))/2
if c == int(c):
    print((int(min(a, b)+c)))
else:
    print('IMPOSSIBLE')


a,b=map(int,input().split())
x=abs(b+a)
if(x%2!=0):
    print("IMPOSSIBLE")
else:
    print(int(x/2))

A, B = map(int, input().split())

k = (A + B) / 2
print(int(k)) if k.is_integer() else print('IMPOSSIBLE')

a,b = map(int,input().split())
if((a+b)%2 == 0):
  print((a+b)//2)
else:
  print('IMPOSSIBLE')

#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate, product # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
import math

#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
# my_round_int = lambda x:np.round((x*2 + 1)//2)
# 四捨五入g
#
# インデックス系
# int min_y = max(0, i - 2), max_y = min(h - 1, i + 2);
# int min_x = max(0, j - 2), max_x = min(w - 1, j + 2);
#
#
import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
#mod = 998244353
from sys import stdin
readline = stdin.readline
def readInts():
  return list(map(int,readline().split()))
def readTuples():
    return tuple(map(int,readline().split()))
def I():
  return int(readline())
a,b = readInts()
print(((a+b)//2 if (a+b)%2 == 0 else 'IMPOSSIBLE'))


a, b = map(int, input().split())
if (a + b) % 2 == 0:
    print((a + b) // 2)
else:
    print("IMPOSSIBLE")

a,b=map(int,input().split())
if (a-b)%2==0:
  print((a+b)//2)
else:
  print("IMPOSSIBLE")

a,b=map(int,input().split())
if (a+b)%2==0:
  print((a+b)//2)
else:
  print("IMPOSSIBLE")

A, B = [int(n) for n in input().split()]
print((A+B)//2 if (A+B)%2==0 else 'IMPOSSIBLE')

#ABC135 A

A,B = map(int,input().split())
if (A+B)/2 % 1 == 0:
    print(int((A+B)/2))
else:
    print("IMPOSSIBLE")

A, B = map(int, input().split())
if (A + B) % 2 != 0:
  print("IMPOSSIBLE")
else:
  print(int((A+B)/2))

def LI():
    return list(map(int, input().split()))


A, B = LI()
if (A+B) % 2 == 0:
    ans = (A+B)//2
else:
    ans = "IMPOSSIBLE"
print(ans)


A, B = map(int, input().split())
if abs(A+B)%2 == 0:
  print(abs(A+B)//2)
else:
  print("IMPOSSIBLE")

a, b = map(int, input().split())
if (a+b) % 2 == 0:
    print((a+b)//2)
else:
    print('IMPOSSIBLE')

a,b = list(map(int,input().split()))
if (abs(a+b))%2 == 0:
  print((abs(a+b)//2))
else:
  print('IMPOSSIBLE')


a,b=map(int,input().split())
x=(a+b)/2
if x.is_integer():
    print(int(x))
else:
    print("IMPOSSIBLE")

import sys
import itertools
tokens = itertools.chain.from_iterable(list(map(str.split, sys.stdin)))

no = 'IMPOSSIBLE'
a = int(next(tokens))
b = int(next(tokens))

# k = (a^2 - b^2) / {2 (a - b)}
k = (a**2 - b**2) // (2 * (a - b))
if abs(a - k) != abs(b - k):
    print(no)
else:
    print(k)


a, b = list(map(int, input().split()))

if abs(a + b) % 2 == 0:
    print((abs(a + b) // 2))
else:
    print('IMPOSSIBLE')


a, b = map(int, input().split())
print('IMPOSSIBLE' if (a ^ b) & 1 else (a + b) >> 1)

a,b = map(int,input().split())
print((a+b)//2 if (a+b)%2==0 else "IMPOSSIBLE")

a,b=map(int,input().split());print(['IMPOSSIBLE',a+(b-a)//2][(b-a)%2==0])

a, b = map(int,input().split())
if (a > b):
  a, b = b, a
if ((b - a)%2 == 0):
  print(a + (b - a)//2)
else:
  print("IMPOSSIBLE")

a=sorted(list(map(int,input().split())))
if a[1]%2==a[0]%2:
  print(a[0]+(a[1]-a[0])//2)
else:
  print('IMPOSSIBLE')

a,b=map(int,input().split())
if abs(a-b)%2==0:
  print((a+b)//2)
else:
  print('IMPOSSIBLE')

a, b = list(map(int, input().split()))

k = int((a + b) / 2)
if abs(a - k) == abs(b - k):
    print(k)
else:
    print("IMPOSSIBLE")


A,B=map(int, input().split())

if (A+B)%2==0:
	print(int((A+B)/2))
else:
	print("IMPOSSIBLE")

a, b = map(int, input().split())
if (a + b) % 2 == 0:
    print((a + b) // 2)
else:
    print('IMPOSSIBLE')

a, b = map(int,input().split())
if (a + b) % 2 == 0:
    print((a + b) // 2)
else:
    print('IMPOSSIBLE')

a,b=map(int,input().split())
print((a+b)//2 if (a+b)%2==0 else 'IMPOSSIBLE')

A, B = list(map(int, input().split()))
if A > B: A, B = B, A
if (B - A) & 1:
    print('IMPOSSIBLE')
    return
print((A + (B - A) // 2))


a, b = list(map(int, input().split()))

if (a+b) % 2 == 0:
    print(int((a+b)//2))
else:
    print("IMPOSSIBLE")

A,B=map(int,input().split())
x=(A**2-B**2)/(2*(A-B))
if x%1==0:
    print(int(x))
else:
    print('IMPOSSIBLE')

a, b = map(int, input().split())
print((a+b)//2 if (a+b)%2 == 0 else 'IMPOSSIBLE')

a, b = list(map(int, input().split()))
if (a - b) % 2 == 0:
    print(((a + b) // 2))
else:
    print('IMPOSSIBLE')


A,B = map(int,input().split())
if abs(A-B) % 2 == 0:
    print(min(A,B) + abs(A-B)//2)
else:
    print("IMPOSSIBLE")

a, b = map(int, input().split())
if (a + b) % 2 == 0: print((a + b) // 2)
else: print('IMPOSSIBLE')

a= list(map(int,input().split()))
if (a[0]+a[1]) % 2 == 0:
  print((a[0]+a[1])//2)
else:
  print("IMPOSSIBLE")

A,B = map(int,input().split())
if(abs(A-B) % 2 == 1):
    print("IMPOSSIBLE")
else:
    print((abs(A-B)//2) + min(A,B))

A,B=map(int, input().split())
 
if (A+B)%2==0:
	print(int((A+B)/2))
else:
	print("IMPOSSIBLE")

a,b=map(int,input().split())
if (a+b)%2 == 0 :
  print(int((a+b)/2))
else :
  print('IMPOSSIBLE')

A,B = list(map(int, input().split()))
print(((A+B) // 2 if (A+B) % 2 == 0
             else 'IMPOSSIBLE'))


a,b = map(int,input().split())

if (a + b) % 2 == 0 :
  print((a+b)//2)
else:
  print('IMPOSSIBLE')

a, b = list(map(int, input().split()))
if (a + b) % 2 == 0:
    print((int((a + b) / 2)))
else:
    print('IMPOSSIBLE')


a,b = map(int,input().split())
print("IMPOSSIBLE" if (a+b)%2!=0 else (a+b)//2)

a, b = [int(i) for i in input().split()]
if (a + b) % 2 == 0:
  print(int(abs(a + b) / 2))
else:
  print('IMPOSSIBLE')

a, b = map(int, input().split())
ans = (a**2-b**2)/(2*(a-b))

if ans.is_integer():
    print(int(ans))
else:
    print('IMPOSSIBLE')

a, b = map(int, input().split(' '))
if (a - b) % 2 == 1:
    print('IMPOSSIBLE')
else:
    print((a + b) // 2)

A,B =map(int,input().split())
if (A+B) % 2 == 0:
    print((A+B)//2)
else:
    print('IMPOSSIBLE')

a, b = map(int, input().split())
print((a + b) // 2 if (a + b) % 2 == 0 else 'IMPOSSIBLE')

A, B = map(int, input().split())

if (A+B)%2 == 0:
    print(int((A+B)/2))
else:
    print("IMPOSSIBLE")

A, B = map(int, input().split())

K = (A+B) // 2
if (A+B)%2 == 0:
  print(K)
else:
  print("IMPOSSIBLE")

A, B = map(int,input().split())
if (A + B) % 2 == 0:
  print(int((A + B) / 2))
else:
  print("IMPOSSIBLE")