#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1);
const int N = 20;
int n;
double l, r, dp[1 << N];
struct lit {
  double x, y, a;
} w[21];
double dis(double x1, double y1, double x2, double y2) {
  double a = (x1 - x2) * (x1 - x2);
  double b = (y1 - y2) * (y1 - y2);
  return sqrt(a + b);
}
double work(double pre, int g) {
  double d = dis(pre, 0, w[g].x, w[g].y);
  double c = acos(fabs(w[g].x - pre) / d);
  if (w[g].x < pre) c = pi - c;
  c = pi - w[g].a - c;
  if (c < 0) {
    printf("%.12f\n", r);
    exit(0);
  }
  double len = d * sin(w[g].a) / sin(c);
  return min(r, pre + len);
}
int main() {
  scanf("%d%lf%lf", &n, &l, &r);
  r -= l;
  for (int i = 0; i < n; i++) {
    scanf("%lf%lf%lf", &w[i].x, &w[i].y, &w[i].a);
    w[i].x -= l;
    w[i].a = w[i].a / 180.0 * pi;
  }
  memset(dp, 0, sizeof(dp));
  int N = 1 << n;
  for (int i = 0; i < N; i++)
    for (int j = 0; j < n; j++) {
      if ((i & (1 << j)) == 0)
        dp[i ^ (1 << j)] = max(dp[i ^ (1 << j)], work(dp[i], j));
    }
  printf("%.12f\n", dp[N - 1]);
  return 0;
}
