#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
int main() {
	double a, b; cin >> a >> b;
	double k = (max(a, b) - min(a, b)) / 2 + min(a, b);
	if (abs(a - k) < 90)cout << k << endl;
	else {
		k += 180;
		if (k >= 360)k -= 360;
		cout << k << endl;
	}
}