#include <bits/stdc++.h>
using namespace std;
double PI = 3.1415926535897932384626433;
double DP[(1 << 20)];
vector<double> fx, fy, lg;
double calc(double px, double py, double t, double al) {
  double d = sqrt((px - t) * (px - t) + py * py);
  double sina = sin(al * (PI / 180.0));
  double sinb = fabs(py) / d;
  double bt = asin(sinb) * (180.0 / PI);
  if (px < t) bt = 180 - bt;
  if (al + bt >= 180) return t + 300000.0;
  double gm = 180 - bt - al;
  double sinc = sin(gm * (PI / 180.0));
  return t + (sina * (d / sinc));
}
int main() {
  int i, mask, n, l, r, cr;
  cin >> n >> l >> r;
  int xx, yy, al;
  double cl = l;
  bool hasp = false;
  for (i = 0; i < n; ++i) {
    cin >> xx >> yy >> al;
    if (yy == 0) {
      if (hasp || xx >= r || xx <= l) {
        cout << r - l << '\n';
        return 0;
      }
      hasp = true;
      cl = xx;
    } else {
      fx.push_back(xx);
      fy.push_back(yy);
      lg.push_back(al);
    }
  }
  n = fx.size();
  DP[0] = cl;
  for (mask = 1; mask < (1 << n); ++mask) {
    DP[mask] = cl;
    for (i = 0; i < n; ++i) {
      if (mask & (1 << i)) {
        cr = mask - (1 << i);
        DP[mask] = max(DP[mask], calc(fx[i], fy[i], DP[cr], lg[i]));
      }
    }
  }
  printf("%.8lf\n", min((double)r, DP[(1 << n) - 1]) - l);
  return 0;
}
