#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=a;i<b;i++)





int r1, r2;
//-----------------------------------------------------------------------------------
int main() {
	cin >> r1 >> r2;

	int d = abs(r2 - r1);
	double ans = (r1 + r2) / 2.0;
	if (180 < d) ans += 180;
	if (360 < ans) ans -= 360;
	printf("%.10f\n", ans);
}