solve :: Int -> Int -> Int -> String
solve _ _ 0 = "IMPOSSIBLE"
solve a b k = if isSolved
              then show k
              else solve a b $ k - 1
  where isSolved = abs (a - k) == abs (b - k)

main :: IO ()
main = do
  [a, b] <- map read . words <$> getLine
  putStrLn . solve a b $ max a b