#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000007;
const int N = (1 << 20) + 10;
int n;
double x[N], y[N], F[N], a[N];
double l, r;
double ans;
const double PI = acos(-1);
double f(double P, int i) {
  double ang = a[i];
  double Y = y[i];
  double X = x[i];
  double Q = atan(abs(X - P) / Y);
  if (P <= X)
    if (Q >= ang)
      return X - Y * tan(Q - ang);
    else
      return X + Y * tan(ang - Q);
  else {
    if (ang + Q > PI / 2) return r;
    return X + Y * tan(ang + Q);
  }
}
bool BitOn(int s, int i) { return 1 & (s >> i); }
void calc(int s) {
  for (int i = 0; i < n; i++)
    if (!BitOn(s, i)) {
      int t = s + (1 << i);
      F[t] = max(F[t], f(F[s], i + 1));
    }
}
int main() {
  cin >> n >> l >> r;
  for (int i = 1; i <= n; i++) {
    cin >> x[i] >> y[i] >> a[i];
    a[i] = a[i] * PI / 180.0;
  }
  for (int i = 0; i < (1 << n); i++) F[i] = l;
  for (int i = 0; i < (1 << n); i++) calc(i);
  printf("%.10lf", min(F[(1 << n) - 1] - l, r - l));
}
