#include <bits/stdc++.h>
using namespace std;
template <class T>
void initvv(vector<vector<T> > &v, int a, int b, const T &t = T()) {
  v.assign(a, vector<T>(b, t));
}
template <class F, class T>
void convert(const F &f, T &t) {
  stringstream ss;
  ss << f;
  ss >> t;
}
int main() {
  double rat = acos(-1.0) / 180.0;
  int n;
  double fr, to;
  scanf("%d%lf%lf", &n, &fr, &to);
  vector<double> xs(n), ys(n), as(n);
  for (int i = 0; i < n; ++i) {
    scanf("%lf%lf%lf", &xs[i], &ys[i], &as[i]);
    as[i] *= rat;
  }
  int last = 1 << n;
  vector<double> dp(last, fr);
  for (int S = 0; S < last; ++S) {
    for (int i = 0; i < n; ++i) {
      if (S >> i & 1) {
        continue;
      }
      double t = min(atan2(-ys[i], dp[S] - xs[i]) + as[i], -1e-10);
      double q = xs[i] - ys[i] / tan(t);
      int T = S | 1 << i;
      dp[T] = max(dp[T], q);
    }
  }
  printf("%.9f\n", min(dp.back(), to) - fr);
}
