#include<stdio.h>
#include<math.h>
#include<vector>
#include<algorithm>
using namespace std;
const double EPS = 1e-10;
const double INF = 1e+10;
const double PI = acos(-1);
int sig(double r) { return (r < -EPS) ? -1 : (r > +EPS) ? +1 : 0; }
inline bool ABS(double a){return max(a,-a);}
struct Pt {
	double x, y;
	Pt() {}
	Pt(double x, double y) : x(x), y(y) {}
	Pt operator+(const Pt &a) const { return Pt(x + a.x, y + a.y); }
	Pt operator-(const Pt &a) const { return Pt(x - a.x, y - a.y); }
	Pt operator*(const Pt &a) const { return Pt(x * a.x - y * a.y, x * a.y + y * a.x); }
	Pt operator-() const { return Pt(-x, -y); }
	Pt operator*(const double &k) const { return Pt(x * k, y * k); }
	Pt operator/(const double &k) const { return Pt(x / k, y / k); }
	double ABS() const { return sqrt(x * x + y * y); }
	double ABS2() const { return x * x + y * y; }
	double arg() const { return atan2(y, x); }
	double dot(const Pt &a) const { return x * a.x + y * a.y; }
	double det(const Pt &a) const { return x * a.y - y * a.x; }
};
double tri(const Pt &a, const Pt &b, const Pt &c) { return (b - a).det(c - a); }
double dSP(Pt a, Pt b, Pt c) {
	if (sig((b - a).dot(c - a)) <= 0) return (c - a).ABS();
	if (sig((a - b).dot(c - b)) <= 0) return (c - b).ABS();
	return ABS(tri(a, b, c)) / (b - a).ABS();
}
int iCC(Pt a, double r, Pt b, double s) {
	double d = (b - a).ABS();
	if (sig(d) == 0 && sig(r - s) == 0) return -1; // correspond
	if (sig(r - s - d) > 0) return +2; // r > s
	if (sig(s - r - d) > 0) return -2; // s > r
	return (sig(r + s - d) >= 0) ? 1 : 0;
}
bool iCS(Pt a, double r, Pt b, Pt c) {
	return (sig(r - dSP(b, c, a)) >= 0 && sig(r - max((b - a).ABS(), (c - a).ABS())) <= 0);
}
pair<Pt,Pt> pCC(Pt a, double r, Pt b, double s) {
	double d = (b - a).ABS();
	double x = (d * d + r * r - s * s) / (d * 2);
	Pt e = (b - a) / d, w = e * Pt(0, 1) * sqrt(max(r * r - x * x, 0.0));
	return make_pair(a + e * x - w, a + e * x + w);
}
pair<Pt,Pt> pCL(Pt a, double r, Pt b, Pt c) {
	Pt h = b + (c - b) * (c - b).dot(a - b) / (c - b).ABS2(); // perp(b, c, a)
	double d = (h - a).ABS();
	double y = sqrt(max(r * r - d * d, 0.0));
	Pt e = (c - b) / (c - b).ABS();
	return make_pair(h - e * y, h + e * y);
}
int x[11];
int y[11];
int z[11];
Pt p[11];
double r[11];
int main(){
	int a,b;
	while(scanf("%d%d",&a,&b),a){
		for(int i=0;i<a;i++)scanf("%d%d%d",x+i,y+i,z+i);
		for(int i=0;i<a;i++)p[i]=Pt(x[i],y[i]);
		double L=0;
		double R=200;
		for(int i=0;i<50;i++){
			double M=(L+R)/2;
			vector<Pt> v;
			for(int j=0;j<a;j++){
				if((double)z[j]>M)r[j]=M;
				else r[j]=sqrt(M*z[j]*2-z[j]*z[j]);
			}
			double dis;
			if((double)b>M)dis=M;
			else dis=sqrt(M*b*2-b*b);
			if(dis>=50){
				R=M;continue;
			}
			for(int j=0;j<a;j++){
				for(int k=j+1;k<a;k++){
					if(iCC(p[j],r[j],p[k],r[k])==1){
						pair<Pt,Pt> tmp=pCC(p[j],r[j],p[k],r[k]);
						v.push_back(tmp.first);
						v.push_back(tmp.second);
					}
				}
				if(iCS(p[j],r[j],Pt(dis,dis),Pt(dis,-dis+100))){
					pair<Pt,Pt>tmp=pCL(p[j],r[j],Pt(dis,dis),Pt(dis,-dis+100));
					v.push_back(tmp.first);v.push_back(tmp.second);
				}
				if(iCS(p[j],r[j],Pt(-dis+100,dis),Pt(-dis+100,-dis+100))){
					pair<Pt,Pt>tmp=pCL(p[j],r[j],Pt(-dis+100,dis),Pt(-dis+100,-dis+100));
					v.push_back(tmp.first);v.push_back(tmp.second);
				}
				if(iCS(p[j],r[j],Pt(dis,dis),Pt(-dis+100,-dis))){
					pair<Pt,Pt>tmp=pCL(p[j],r[j],Pt(dis,dis),Pt(-dis+100,dis));
					v.push_back(tmp.first);v.push_back(tmp.second);
				}
				if(iCS(p[j],r[j],Pt(dis,-dis+100),Pt(-dis+100,-dis+100))){
					pair<Pt,Pt>tmp=pCL(p[j],r[j],Pt(dis,-dis+100),Pt(-dis+100,-dis+100));
					v.push_back(tmp.first);v.push_back(tmp.second);
				}
			}
			v.push_back(Pt(dis,dis));
			v.push_back(Pt(dis,-dis+100));
			v.push_back(Pt(-dis+100,dis));
			v.push_back(Pt(-dis+100,-dis+100));
			
			bool ok=false;
			for(int i=0;i<v.size();i++){
				if(v[i].x<dis-EPS||v[i].x>-dis+100+EPS||v[i].y<dis-EPS||v[i].y>-dis+100+EPS)continue;
				bool OK=true;
				for(int j=0;j<a;j++)if(r[j]*r[j]-EPS>(v[i].x-x[j])*(v[i].x-x[j])+(v[i].y-y[j])*(v[i].y-y[j]))OK=false;
				if(OK){ok=true;break;}
			}
			if(ok)L=M;else R=M;
		}
		printf("%.12f\n",L);
	}
}

Measured memory_bytes: 1088