import           Control.Monad
import qualified Data.ByteString.Char8 as BS
import           Data.List
import           Data.Maybe

readInts :: IO [Int]
readInts = map (fst . fromJust . BS.readInt) . BS.words <$> BS.getLine

main = do
  nums <- readInts
  putStrLn $ solve (head nums) (nums !! 1)

solve :: Int -> Int -> String
solve a b
  | null k = "IMPOSSIBLE"
  | otherwise = show $ head k
  where
    f a b k = a * a - 2 * a * k == b * b - 2 * b * k
    k
      | a <= b = [k | k <- [a .. b], f a b k]
      | otherwise = [k | k <- [b .. a], f a b k]
