#include <bits/stdc++.h>
using namespace std;
int n;
double dp[2210000], x[2210000], y[2210000], a[2210000];
double l, r;
int main() {
  cin >> n;
  cin >> l >> r;
  for (int i = 0; i < n; i++) cin >> x[i] >> y[i] >> a[i];
  for (int i = 0; i < n; i++)
    y[i] = max(y[i], -y[i]), a[i] = a[i] / 180.0 * acos(-1.0);
  dp[0] = l;
  bool flag = true;
  for (int s = 1; s < (1 << n); s++) {
    dp[s] = l;
    for (int j = 0; j < n; j++) {
      if ((s >> j) & 1) {
        int ns = s ^ (1 << j);
        if (fabs(y[j]) < 1e-8) {
          if (x[j] < dp[ns] + 1e-8)
            dp[s] = r;
          else
            dp[s] = max(dp[s], max(dp[ns], x[j]));
        } else {
          double theta = atan((dp[ns] - x[j]) / y[j]) + a[j];
          if (theta > acos(-1.0) / 2.0 - 1e-8) {
            dp[(1 << n) - 1] = r;
            flag = false;
            break;
          }
          double nx = x[j] + y[j] * tan(theta);
          dp[s] = max(dp[s], max(dp[ns], nx));
        }
      }
    }
  }
  if (!flag) dp[(1 << n) - 1] = r;
  cout << fixed << setprecision(11) << min(r, dp[(1 << n) - 1]) - l << endl;
  return 0;
}
