#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
#include<complex>
using namespace std;

//#define int long long
typedef long long ll;

typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = (1e+18) + 7;
typedef pair<int, int>P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
#define all(v) (v).begin(),(v).end()
typedef pair<ll, ll> LP;
typedef long double ld;
typedef pair<ld, ld> LDP;
const ld eps = 1e-6;
const ld pi = acos(-1.0);
//typedef vector<vector<ll>> mat;
typedef vector<int> vec;

ll mod_pow(ll a, ll n) {
	ll res = 1;
	while (n) {
		if (n & 1)res = res * a%mod;
		a = a * a%mod; n >>= 1;
	}
	return res;
}

struct modint {
	ll n;
	modint() :n(0) { ; }
	modint(ll m) :n(m) {
		if (n >= mod)n %= mod;
		else if (n < 0)n = (n%mod + mod) % mod;
	}
	operator int() { return n; }
};
bool operator==(modint a, modint b) { return a.n == b.n; }
modint operator+=(modint &a, modint b) { a.n += b.n; if (a.n >= mod)a.n -= mod; return a; }
modint operator-=(modint &a, modint b) { a.n -= b.n; if (a.n < 0)a.n += mod; return a; }
modint operator*=(modint &a, modint b) { a.n = ((ll)a.n*b.n) % mod; return a; }
modint operator+(modint a, modint b) { return a += b; }
modint operator-(modint a, modint b) { return a -= b; }
modint operator*(modint a, modint b) { return a *= b; }
modint operator^(modint a, int n) {
	if (n == 0)return modint(1);
	modint res = (a*a) ^ (n / 2);
	if (n % 2)res = res * a;
	return res;
}

//ll inv(ll a, ll p) {
//	return (a == 1 ? 1 : (1 - p * inv(p%a, a)) / a + p);
//}
//modint operator/(modint a, modint b) { return a * modint(inv(b, mod)); }

int dx[4] = { 1,0,-1,0 };
int dy[4] = { 0,1,0,-1 };

using Point = complex<ld>;
ld dot(Point a, Point b) { return real(conj(a)*b); }
ld cross(Point a, Point b) { return imag(conj(a)*b); }
struct Line {
	Point a, b;
};
struct Circle {
	Point p; ld r;
};

Point proj(Line l, Point p) {
	ld t = dot(p - l.a, l.a - l.b) / norm(l.a - l.b);
	return l.a + t * (l.a - l.b);
}
ld dist_lp(Line l, Point p) {
	return abs(p - proj(l, p));
}

vector<Point> is_lc(Circle c, Line l) {
	vector<Point> res;
	ld d = dist_lp(l, c.p);
	if (d > c.r + eps)return res;
	ld len = (d > c.r) ? 0.0 : sqrt(c.r*c.r - d * d);
	Point nor = (l.a - l.b) / abs(l.a - l.b);
	res.push_back(proj(l, c.p) + len * nor);
	res.push_back(proj(l, c.p) - len * nor);
	return res;
}
vector<Point> is_cc(Circle c1, Circle c2) {
	vector<Point> res;
	ld d = abs(c1.p - c2.p);
	ld rc = (d*d + c1.r*c1.r - c2.r*c2.r) / (2 * d);
	ld dfr = c1.r*c1.r - rc * rc;
	if (abs(dfr) < eps)dfr = 0.0;
	if (dfr < 0.0)return res;
	ld rs = sqrt(dfr);
	Point diff = (c2.p - c1.p) / d;
	res.push_back(c1.p + diff * Point(rc, rs));
	if (dfr != 0.0)res.push_back(c1.p + diff * Point(rc, -rs));
	return res;
}

bool is_in(Circle c, Point p) {
	ld dist = abs(c.p - p);
	return dist < c.r;
}

int n;ld w;
int x[10], y[10], h[10];
Circle c[10];

bool can(ld r) {
	ld le;
	if (r < w)le = r;
	else {
		le = sqrt(pow(r, 2) - pow(r - w, 2));
	}
	if (le >= 50)return false;
	rep(i, n) {
		c[i].p = { (ld)x[i],(ld)y[i] };
		if (r < h[i])c[i].r = r;
		else c[i].r = sqrt(pow(r, 2) - pow(r - h[i], 2));
	}

	ld ri = 100 - le;
	Point p[4] = { {le,le},{le,ri},{ri,le},{ri,ri} };
	Line l[4] = { {p[0],p[1]},{p[0],p[2]},{p[3],p[1]},{p[3],p[2]} };
	rep(i, 4) {
		bool f = true;
		rep(j, n) {
			if (is_in(c[j], p[i])) {
				f = false; break;
			}
		}
		if (f)return true;
	}
	rep(i, 4) {
		rep(j, n) {
			vector<Point> v = is_lc(c[j], l[i]);
			rep(k, v.size()) {
				
				if (real(v[k]) < le || real(v[k])>ri)continue;
				if (imag(v[k]) < le || imag(v[k]) > ri)continue;
				bool f = true;
				rep(l, n) {
					if (l == j)continue;
					if (is_in(c[l], v[k])) {
						f = false; break;
					}
				}
				if (f)return true;
			}
		}
	}
	rep(i, n)Rep(j,i+1, n) {
		vector<Point> v = is_cc(c[i], c[j]);
		rep(k, v.size()) {
			if (real(v[k]) < le || real(v[k])>ri)continue;
			if (imag(v[k]) < le || imag(v[k]) > ri)continue;
			bool f = true;
			rep(l, n) {
				if (l == i || l == j)continue;
				if (is_in(c[l], v[k])) {
					f = false; break;
				}
			}
			if (f)return true;
		}
	}
	return false;
}
void solve() {
	cin >> w;
	rep(i, n) {
		cin >> x[i] >> y[i] >> h[i];
	}
	ld le = 0, ri = (w*w+2500)/(2*w);
	rep (aa,100) {
		ld mid = (le + ri) / 2;
		if (can(mid))le = mid;
		else ri = mid;
	}
	cout << le << endl;
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout << fixed << setprecision(5);
	//init();
	//int t; cin >> t; rep(i, t)solve();
	while (cin >> n, n)solve();
	//solve();
	stop
		return 0;
}



Measured memory_bytes: 3304