#include <bits/stdc++.h>
using namespace std;
double x[30], y[30], a[30];
int state[1 << 20];
int bitcount(int b) {
  int con = 0;
  while (b) {
    b -= (b & -b);
    con++;
  }
  return con;
}
bool cmp(int a, int b) { return bitcount(a) < bitcount(b); }
double dp[1 << 20];
void rotate(double &x, double &y, double a) {
  double tx, ty;
  tx = cos(a) * x - sin(a) * y;
  ty = sin(a) * x + cos(a) * y;
  x = tx;
  y = ty;
}
double l, r;
const double eps = 1e-9;
int sgn(double v) {
  if (abs(v) < eps)
    return 0;
  else
    return v < 0 ? -1 : 1;
}
const double pi = acos(-1);
double find_max() {
  int n, i, j;
  double t, d, nx, ny;
  scanf("%d %lf %lf", &n, &l, &r);
  for (i = 0; i < n; i++) scanf("%lf %lf %lf", &x[i], &y[i], &a[i]);
  for (i = 0; i < (1 << n); i++) state[i] = i;
  sort(state, state + (1 << n), cmp);
  dp[0] = 0;
  for (i = 0; i < (1 << n); i++) {
    for (j = 0; j < n; j++) {
      if ((1 << j) & state[i]) continue;
      d = dp[state[i]] + l;
      nx = d - x[j];
      ny = -y[j];
      rotate(nx, ny, a[j] / 180 * pi);
      t = -y[j] / ny;
      if (sgn(ny) == 0) return r - l;
      if (sgn(t) < 0) return r - l;
      dp[state[i] | (1 << j)] =
          max(dp[state[i] | (1 << j)], dp[state[i]] + (x[j] + t * nx - d));
    }
  }
  return min(dp[(1 << n) - 1], r - l);
}
int main() {
  printf("%.9f\n", find_max());
  return 0;
}
