#include <iostream>

int main(void){

	double th1, th2, temp, answer;

	std::cin >> th1 >> th2;
	
	if(th1>th2){
		temp = th1;
		th1 = th2;
		th2 = temp;
	}

	if(th2 - th1 < 180.0){
		answer = (th1+th2) / 2.0;
	}else{
		answer = ( th1+(th2-360) ) / 2.0;
	}
	if(answer<0) answer = 360.0 + answer;

	std::cout << answer << std::endl;

	return 0;
}

