#include <bits/stdc++.h>
using namespace std;
const int MAXN = 20 + 10;
int n, first[MAXN], second[MAXN], a[MAXN], l, r;
double f[1 << 20];
double calc(double d, int id) {
  double agl = atan2(-second[id], d + l - first[id]);
  agl -= -M_PI / 2;
  agl += M_PI / 2 * a[id] / 90;
  if (agl / M_PI * 180 > 90 - 1e-10) return 1e6;
  return (double)first[id] + (double)second[id] * tan(agl) - l;
}
int main() {
  cin >> n >> l >> r;
  for (int i = 1; i <= n; ++i) cin >> first[i] >> second[i] >> a[i];
  for (int i = 1; i < (1 << n); ++i)
    for (int j = 0; j < n; ++j)
      if (i & (1 << j)) f[i] = max(f[i], calc(f[i - (1 << j)], j + 1));
  printf("%.10lf\n", min(f[(1 << n) - 1], (double)r - l));
  fclose(stdin);
  fclose(stdout);
  return 0;
}
