
#if 1
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <array>
#include <deque>
#include <algorithm>
#include <utility>
#include <cstdint>
#include <functional>
#include <iomanip>
#include <numeric>

#define in std::cin
#define out std::cout

int main()
{
	using std::endl;
	in.sync_with_stdio(false);
	out.sync_with_stdio(false);

	auto set = [](double v) {if (v >= 360) { v -= 360; }return v; };
	int32_t arg1, arg2;
	in >> arg1>> arg2;
	using std::abs;
	int32_t res = arg2 - arg1;
	int32_t tmp = (arg2 + 360) - arg1;
	if (abs(res) > abs(tmp)) { res = tmp; }
	tmp = (arg1 + 360) - arg2;
	if (abs(res) > abs(tmp)) {
		out << set(tmp / 2.0 + arg2) << endl;
	}
	else {
		out << set(res / 2.0 + arg1) << endl;
	}

	return 0;
}
#endif