#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;

	if (r1 > r2) swap(r1, r2);

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