#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 99999999999999999
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;



struct Point{
	Point(double arg_x,double arg_y){
		x = arg_x;
		y = arg_y;
	}

	Point(){
		x = y = 0.0;
	}

	Point operator + (Point p){ return Point(x+p.x,y+p.y); }
	Point operator - (Point p){ return Point(x-p.x,y-p.y);}
	Point operator * (double a){ return Point(a*x,a*y); }
	Point operator / (double a){ return Point(x/a,y/a); }

	double abs(){ return sqrt(norm()); }
	double norm(){ return x*x + y*y; }

	bool operator<(const Point &p) const{
		return x != p.x? x < p.x: y < p.y;
	}

	bool operator == (const Point &p) const{
		return fabs(x-p.x) < EPS && fabs(y-p.y) < EPS;
	}

	double x,y;
};

typedef Point Vector;

struct Line{
	Line(Point a,Point b){
		p[0] = a;
		p[1] = b;
	}
	Point p[2];
};

struct Circle{
	Point center;
	double height,r;
};

int N,H;
Circle info[10],work[10];

double norm(Vector a){
	return a.x*a.x+a.y*a.y;
}

double abs(Vector a){
	return sqrt(norm(a));
}

double cross(Vector a,Vector b){
    return a.x*b.y-a.y*b.x;
}

double dot(Vector a,Vector b){
    return a.x*b.x + a.y*b.y;
}

double arg(Vector p){
	return atan2(p.y,p.x);
}

Vector polar(double a,double r){
	return Point(cos(r)*a,sin(r)*a);
}

Point project(Line l,Point p){

	Vector base = l.p[1]-l.p[0];
	double r = dot(p-l.p[0],base)/norm(base);
	return l.p[0]+base*r;
}

//円と直線の交点を求める関数
vector<Point> getCrossPoints(Circle c,Line l){

	vector<Point> ret;

	Vector pr = project(l,c.center);
	Vector e = (l.p[1]-l.p[0])/abs(l.p[1]-l.p[0]);

	double base;

	if(fabs(c.r*c.r-norm(pr-c.center)) < EPS){

		base = 0;
	}else{
		base = sqrt(c.r*c.r-norm(pr-c.center));
	}

	ret.push_back(Point(pr+e*base));
	ret.push_back(Point(pr-e*base));

	return ret;
}

vector<Point> getCrossPoints(Circle c1,Circle c2){

	vector<Point> res;

	double d = abs(c1.center-c2.center);
	double a = acos((c1.r*c1.r+d*d-c2.r*c2.r)/(2*c1.r*d));
	double t = arg(c2.center-c1.center);

	res.push_back(Point(c1.center+polar(c1.r,t+a)));
	res.push_back(Point(c1.center+polar(c1.r,t-a)));

	return res;
}

double calc_dist(Point A,Point B){

	return sqrt((A.x-B.x)*(A.x-B.x)+(A.y-B.y)*(A.y-B.y));
}


bool is_OK(double R){

	for(int i = 0; i < N; i++){

		work[i] = info[i];
	}

	//球の中心を置けない範囲を円にする
	for(int i = 0; i < N; i++){

		if(info[i].height > R){

			work[i].r = R;

		}else{ //info[i].height <= R

			work[i].r = sqrt(info[i].height*(2*R-info[i].height));
		}
	}


	//正方形の壁の内側に、円を置き得る範囲の正方形を作る
	double L = 100,diff;
	double d_H = H;

	if(d_H > R){ //壁が球の半径より高い場合

		diff = R;

	}else{

		diff = sqrt(d_H*(2*R-d_H));
	}

	if(2*diff >= L){

		return false;
	}

	//4隅の点を作成
	Point left_under  = Point(diff,diff);
	Point right_under = Point(L-diff,diff);
	Point right_top = Point(L-diff,L-diff);
	Point left_top = Point(diff,L-diff);

	vector<Line> LINE;
	LINE.push_back(Line(left_top,left_under));
	LINE.push_back(Line(left_under,right_under));
	LINE.push_back(Line(right_under,right_top));
	LINE.push_back(Line(right_top,left_top));


	//★少なくとも1つ、どの円にも含まれていない(辺上を除く)地点があるか調べる
	vector<Point> POINT;

	POINT.push_back(left_under);
	POINT.push_back(right_under);
	POINT.push_back(right_top);
	POINT.push_back(left_top);

	vector<Point> tmp_point;

	for(int i = 0; i < N; i++){

		for(int k = 0; k < LINE.size(); k++){

			tmp_point =getCrossPoints(work[i],LINE[k]);

			for(int a = 0; a < tmp_point.size(); a++){

				POINT.push_back(tmp_point[a]);
			}
			tmp_point.clear();
		}

		//円と円の交点
		for(int k = i+1; k < N; k++){

			tmp_point = getCrossPoints(work[i],work[k]);

			for(int a = 0; a < tmp_point.size(); a++){

				POINT.push_back(tmp_point[a]);
			}

			tmp_point.clear();
		}
	}


	//少なくとも1つ、どの円の内部にも属していない点があれば良い
	for(int i = 0; i < POINT.size(); i++){

		bool FLG = true;

		for(int k = 0; k < N; k++){
			if(calc_dist(POINT[i],work[k].center)+EPS < work[k].r){
				FLG = false;
				break;
			}
		}
		if(!FLG)continue;

		if(POINT[i].x+EPS >= diff && POINT[i].x-EPS <= L-diff && //壁際との余裕も確認
				POINT[i].y+EPS >= diff && POINT[i].y-EPS <= L-diff){

			return true;
		}
	}

	return false;
}



void func(){

	for(int i = 0; i < N; i++){

		scanf("%lf %lf %lf",&info[i].center.x,&info[i].center.y,&info[i].height);
	}

	//半径について二分探索
	double L = 0,R = 1000,mid = (L+R)/2;
	double ans = 0;

	for(int loop = 0; loop < 100 && fabs(R-L) > EPS; loop++){

		if(is_OK(mid)){

			ans = mid;
			L = mid+EPS;

		}else{

			R = mid-EPS;
		}
		mid = (L+R)/2;
	}

	printf("%.10lf\n",ans);
}

int main(){

	while(true){

		scanf("%d %d",&N,&H);
		if(N == 0)break;

		func();
	}

	return 0;
}



Measured memory_bytes: 3724