fun main(args:Array<String>):Unit {
    val a = readLine()!!.trim().toDouble()
    val b = readLine()!!.trim().toDouble()
    val mid = normalize((a + b) / 2)
    if (maxOf(a, b) - mid > 90){
        println(normalize(mid + 180))
    }else{
        println(mid)
    }
}
fun normalize(a:Double):Double{
    var res = a
    if (a < 0){
        while (res < 0){
            res += 360
        }
    }else{
        while(res > 360){
            res -= 360
        }
    }
    return res
}
