fmod v m
  | v >  m    = fmod (v-2*m) m
  | v < -m    = fmod (v+2*m) m
  | otherwise = v

fmod' v m
  | v >  m    = fmod (v-m) m
  | v <  0    = fmod (v+m) m
  | otherwise = v

ans [t1,t2] =
  let t0 = fmod (t1 - t2 + 360) 180
      s0 = (fromIntegral t0) / 2.0 + (fromIntegral t2) :: Float
      s1 = fmod' s0 360
  in
    s1

main = do
  c <- getContents
  let i = map read $ lines c :: [Int]
      o = ans i
  print o

