#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-10;
const double pi = acos(-1.0);
const int inf = 1 << 30;
const int INF = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
const int maxn = 22;
double dp[1 << maxn];
double l, r;
struct point {
  double x, y, d;
  void input() {
    scanf("%lf%lf%lf", &x, &y, &d);
    d = d * pi / 180;
    x -= l;
    y = fabs(y);
  }
} p[maxn];
double get(int id, double x) {
  double ans = atan((r - p[id].x) / p[id].y);
  double now = min(ans, atan((x - p[id].x) / p[id].y) + p[id].d);
  return p[id].x + p[id].y * tan(now);
}
int main() {
  int n;
  cin >> n >> l >> r;
  r -= l;
  for (int i = 0; i < n; ++i) p[i].input();
  for (int i = 0; i < (1 << n); ++i) {
    for (int j = 0; j < n; ++j) {
      if (i & (1 << j)) continue;
      dp[i | (1 << j)] = max(dp[i | (1 << j)], get(j, dp[i]));
    }
  }
  printf("%.12lf\n", dp[(1 << n) - 1]);
  return 0;
}
