#include <bits/stdc++.h>
using namespace std;
inline int gi() {
  int f = 1, sum = 0;
  char ch = getchar();
  while (ch > '9' || ch < '0') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    sum = (sum << 3) + (sum << 1) + ch - '0';
    ch = getchar();
  }
  return f * sum;
}
const int N = 100010;
struct node {
  double x, y;
  node operator+(const node b) const { return (node){x + b.x, y + b.y}; }
  node operator-(const node b) const { return (node){x - b.x, y - b.y}; }
  node operator*(const double b) const { return (node){x * b, y * b}; }
  double len() { return sqrt(x * x + y * y); }
};
double cross(node a, node b) { return a.x * b.y - a.y * b.x; }
node st, p[N][2];
double T[N], w, h;
int n;
const double eps = 1e-8;
bool cmpx(node A, node B) {
  if (A.y != B.y) return A.y < B.y;
  return A.x < B.x;
}
bool cmpc(node A, node B) {
  return cross(A, B) > 0 || (fabs(cross(A, B)) < eps && A.len() < B.len());
}
node s[N];
void Convex(node *P, int &cnt) {
  sort(&P[1], &P[cnt + 1], cmpx);
  node base = P[1];
  for (int i = 1; i <= cnt; i++) P[i] = P[i] - base;
  sort(&P[1], &P[cnt + 1], cmpc);
  int top = 0;
  for (int i = 1; i <= cnt; i++) {
    if (i != 1 && (P[i] - P[i - 1]).len() < eps) continue;
    while (top >= 2 && cross(P[i] - s[top - 1], s[top] - s[top - 1]) >= 0)
      --top;
    s[++top] = P[i];
  }
  for (int i = 1; i <= top; i++) P[i] = s[i] + base;
  cnt = top;
  return;
}
bool In_it(node *C, int n, node p) {
  if (n == 1) return (C[1] - p).len() < eps;
  if (n == 2)
    return fabs((C[2] - C[1]).len() - (C[2] - p).len() - (C[1] - p).len()) <
           eps;
  for (int i = 1; i <= n; i++)
    if (cross(C[i + 1] - C[i], p - C[i]) < 0) return 0;
  return 1;
}
bool Intersection(node A1, node A2, node B1, node B2) {
  if ((A1 - A2).len() < eps && (B1 - B2).len() < eps)
    return (fabs(A1.x - B1.x) < eps) && (fabs(A1.y - B1.y) < eps);
  if ((A1 - A2).len() < eps) swap(A1, B1), swap(A2, B2);
  if ((B1 - B2).len() < eps)
    return fabs((A1 - A2).len() - (A1 - B1).len() - (A2 - B1).len()) < eps;
  return (cross(B2 - B1, A1 - B1) * cross(B2 - B1, A2 - B1) <= 0) &&
         (cross(A2 - A1, B1 - A1) * cross(A2 - A1, B2 - A1) <= 0);
}
node GetIntersection(node A1, node A2, node B1, node B2) {
  if ((B1 - B2).len() < eps && (A1 - A2).len() < eps) return A1;
  if ((A1 - A2).len() < eps) return A1;
  if ((B1 - B2).len() < eps) return B1;
  if ((A1 - B1).len() < eps) return A1;
  if ((A1 - B2).len() < eps) return A1;
  if ((A2 - B1).len() < eps) return A2;
  if ((A2 - B2).len() < eps) return A2;
  double t = fabs(cross(B2 - B1, A1 - B1) / cross(A2 - A1, B2 - B1));
  return A1 + (A2 - A1) * t;
}
bool check(double v) {
  node Left = st, Right = st;
  node Sqr[4] = {(node){v, v}, (node){v, -v}, (node){-v, v}, (node){-v, -v}};
  for (int i = 1; i <= n; i++) {
    int cnt = 0, ncnt = 0;
    node c[10], nn[10];
    for (int j = 0; j < 4; j++)
      c[++cnt] = Left + Sqr[j] * (T[i] - T[i - 1]),
      c[++cnt] = Right + Sqr[j] * (T[i] - T[i - 1]);
    Convex(c, cnt);
    c[cnt + 1] = c[1];
    for (int j = 1; j <= cnt; j++) {
      if (Intersection(c[j], c[j + 1], p[i][0], p[i][1])) {
        node O = GetIntersection(c[j], c[j + 1], p[i][0], p[i][1]);
        if (ncnt == 0 || (nn[ncnt - 1] - O).len() > eps) nn[ncnt++] = O;
      }
    }
    if (ncnt == 0) {
      if (In_it(c, cnt, p[i][0]) && In_it(c, cnt, p[i][1]))
        nn[ncnt++] = p[i][0], nn[ncnt++] = p[i][1];
      else if (In_it(c, cnt, p[i][0]))
        nn[0] = nn[1] = p[i][0], ncnt = 2;
      else if (In_it(c, cnt, p[i][1]))
        nn[0] = nn[1] = p[i][1], ncnt = 2;
      else
        return false;
    } else if (ncnt == 1) {
      if (In_it(c, cnt, p[i][0]))
        nn[ncnt++] = p[i][0];
      else if (In_it(c, cnt, p[i][1]))
        nn[ncnt++] = p[i][1];
      else
        nn[1] = nn[0], ++ncnt;
    }
    Left = nn[0];
    Right = nn[1];
  }
  return true;
}
int main() {
  n = gi();
  scanf("%lf%lf", &w, &h);
  scanf("%lf%lf", &st.x, &st.y);
  for (int i = 1; i <= n; i++) {
    double a, b;
    scanf("%lf%lf%lf", &T[i], &a, &b);
    double lx = 0, rx = w, ly = 0, ry = w;
    lx = max(lx, a - b * (w - a) / (h - b));
    ly = max(ly, a - (w - a) * (h - b) / b);
    rx = min(rx, a + a * b / (h - b));
    ry = min(ry, a + a * (h - b) / b);
    p[i][0] = (node){lx, ry};
    p[i][1] = (node){rx, ly};
  }
  double l = 0, r = w * 2, ans = -1;
  while (r - l > eps) {
    double mid = (l + r) / 2;
    if (check(mid)) {
      r = mid;
      ans = mid;
    } else
      l = mid;
  }
  printf("%.7lf\n", ans);
  return 0;
}
