#include <bits/stdc++.h>
using namespace std;
typedef complex<double> P;

const double inf = 1.0 / 0.0;
const double eps = 1e-8;
bool equals(double a, double b) { return abs(a - b) < eps; }

struct C {
  P p;
  double r;
};


double dot  (P a, P b) { return a.real()*b.real() + a.imag()*b.imag(); }
double cross(P a, P b) { return a.real()*b.imag() - a.imag()*b.real(); }

P project(P s1, P s2, P p) {
  P base = s2 - s1;
  double t = dot(p - s1, base)/norm(base);
  return s1 + base*t;
}

double getDistanceLP(P s1, P s2, P p) {
  return abs(cross(s2 - s1, p - s1)/abs(s2 - s1));
}

int isIntersect(C a, C b) {
  double x = a.p.real() - b.p.real();
  double y = a.p.imag() - b.p.imag();
  double s = a.r + b.r;
  double d = x*x + y*y;
  s *= s;
  if(equals(d, s)) return 1;
  if(d > s) return 0;
  double r = abs(a.r - b.r);
  r *= r;
  if(equals(d, r)) return -1;
  if(d > r) return 2;
  return -2;
}

int isIntersect(P s1, P s2, C c) {
  double d = getDistanceLP(s1, s2, c.p);
  if(equals(d, c.r)) return 1;
  else if(d < c.r) return 2;
  else return 0;
}

vector<P> getCrossP(C c1, C c2) {
  vector<P> v;
  int cp = isIntersect(c1,c2);
  if(cp == 0 || cp == -2) return v;
  
  double ll = norm(c1.p - c2.p);
  double A = ( c1.r * c1.r - c2.r * c2.r + ll ) / ( 2.0 * ll );
  P base = c2.p - c1.p;

  if(abs(cp) == 1) {
    v.push_back(c1.p + A*base);
  } else {
    P n(-base.imag(), base.real());
    n /= abs(n);
    double h = sqrt(c1.r * c1.r - A*A*ll);
    v.push_back(c1.p + A*base + h*n);
    v.push_back(c1.p + A*base - h*n);
  }
  return v;
}

vector<P> getCrossPLC(P s1, P s2, C c) {
  vector<P> v;
  P p = project(s1, s2, c.p);
  int ii = isIntersect(s1, s2, c);
  if(ii == 1) {
    v.push_back(p);
  } else if (ii == 2) {
    double h = abs(p - c.p);
    double d = sqrt(c.r*c.r - h*h);
    P base = s2 - s1;
    v.push_back(p + d*base/abs(base));
    v.push_back(p - d*base/abs(base));
  }
  return v;
}

double getDist(double x1, double y1, double z1, 
               double x2, double y2, double z2) {
  return sqrt((x1 - x2) * (x1 - x2) + 
              (y1 - y2) * (y1 - y2) +
              (z1 - z2) * (z1 - z2));
}

const int MAXN = 11;
int n;
double w;
P ps[MAXN];
double h[MAXN];

C getC(P p, double h, double r) {
  if (r > h) {
    return (C){p, sqrt(2.0 * r * h - h * h)};
  } else {
    return (C){p, r};
  }
}

bool ok(double r) {
  vector<C> cs(n);
  for (int i = 0; i < n; ++i) {
    cs[i] = getC(ps[i], h[i], r);
  }
  vector<pair<P, P> > seg;
  double d = 0;
  if (r > w) {
    d = sqrt(2.0 * r * w - w * w);
  } else {
    d = r;
  }
  seg.push_back(make_pair(P(0, d), P(100, d)));
  seg.push_back(make_pair(P(0, 100 - d), P(100, 100 - d)));
  seg.push_back(make_pair(P(d, 0), P(d, 100)));
  seg.push_back(make_pair(P(100 - d, 0), P(100 - d, 100)));

  vector<P> cp;
  cp.push_back(P(50, 50));
  for (int i = 0; i < cs.size(); ++i) {
    cp.push_back(P(cs[i].p.real() + cs[i].r, cs[i].p.imag()));
    for (int j = i + 1; j < cs.size(); ++j) {
      vector<P> tmp = getCrossP(cs[i], cs[j]);
      cp.insert(cp.begin(), tmp.begin(), tmp.end());
    }
    for (int j = 0; j < seg.size(); ++j) {
      vector<P> tmp = getCrossPLC(seg[j].first, seg[j].second, cs[i]);
      cp.insert(cp.begin(), tmp.begin(), tmp.end());
    }
  }

  for (int i = 0; i < cp.size(); ++i) {
    P p = cp[i];
    if (p.real() < 0 || p.real() > 100 || p.imag() < 0 || p.imag() > 100) continue;
    double dist, mini = inf;
    for (int j = 0; j < n; ++j) {
      dist = getDist(p.real(), p.imag(), r,
                     ps[j].real(), ps[j].imag(), min(r, h[j]));
      mini = min(mini, dist);
    }
    dist = getDist(p.real(), p.imag(), r, p.real(), 0, min(r, w));
    mini = min(mini, dist);
    dist = getDist(p.real(), p.imag(), r, p.real(), 100, min(r, w));
    mini = min(mini, dist);
    dist = getDist(p.real(), p.imag(), r, 0, p.imag(), min(r, w));
    mini = min(mini, dist);
    dist = getDist(p.real(), p.imag(), r, 100, p.imag(), min(r, w));
    mini = min(mini, dist);
    if (mini + eps > r) return true;
  }
  return false;
}

int main() {
  while (cin >> n >> w && (n|(w!=0.0))) {
    for (int i = 0; i < n; ++i) {
      cin >> ps[i].real() >> ps[i].imag() >> h[i];
    }
    double low, high;
    low = 0, high = 10000;
    for (int step = 0; step < 100; ++step) {
      double r = (low + high) / 2.0;
      if (ok(r)) {
        low = r;
      } else {
        high = r;
      }
    }
    printf("%.5f\n", low);
  }
  return 0;
}

Measured memory_bytes: 1284