#include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
#include <string>
#include <algorithm>
#include <iostream>
#include <string>
#include <map>
#include <set>
#include <functional>
#include <iostream>
#define MOD 1000000007LL
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

double a,b;

int main(void){
	scanf("%lf%lf",&a,&b);
	if(b<a)swap(a,b);
	if(b-a<=180.0)printf("%.9f\n",(a+b)/2.0);
	else{
		b-=360.0;
		double c=(a+b)/2.0;
		printf("%.9f\n",c>0?c:360.0+c);
	}
	return 0;
}