#include <bits/stdc++.h>
using namespace std;
double dp[1 << 21];
const double pi = acos(-1);
struct node {
  double x, y, a;
} s[25];
int n;
double l, r;
double get(double x, int p) {
  x += l;
  double a = s[p].a / 180 * pi, re = 0;
  double y = s[p].y;
  if (x <= s[p].x) {
    double ll = sqrt(y * y + (s[p].x - x) * (s[p].x - x));
    a -= acos(y / ll);
    if (a >= pi / 2) return r - l;
    re = tan(a) * y + sqrt(ll * ll - y * y);
  } else {
    x -= s[p].x;
    a += atan(x / y);
    if (a >= pi / 2) return r - l;
    re = y * tan(a) - x;
  }
  return re;
}
int main() {
  cin >> n >> l >> r;
  for (int i = 0; i < n; i++) cin >> s[i].x >> s[i].y >> s[i].a;
  int lim = 1 << n;
  for (int i = 0; i < lim; i++) {
    if (dp[i] == r - l) continue;
    for (int j = 0; j < n; j++) {
      if (i & (1 << j)) continue;
      dp[i + (1 << j)] = max(dp[i + (1 << j)], dp[i] + get(dp[i], j));
    }
  }
  double ans = 0;
  for (int i = 1; i < lim; i++) ans = max(ans, dp[i]);
  printf("%.9lf\n", min(ans, r - l));
  return 0;
}
