Problem: An open-top box having a square bottom is placed on the floor. You see a number of needles vertically planted on its bottom.

You want to place a largest possible spheric balloon touching the box bottom, interfering with none of the side walls nor the needles.

Java Specific: Submitted Java programs may not use "java.awt.geom.Area". You may use it for your debugging purposes.

Figure H.1 shows an example of a box with needles and the corresponding largest spheric balloon. It corresponds to the first dataset of the sample input below.

<image>
Figure H.1. The upper shows an example layout and the lower shows the largest spheric balloon that can be placed.



Input

The input is a sequence of datasets. Each dataset is formatted as follows.


n w
x1 y1 h1
:
xn yn hn


The first line of a dataset contains two positive integers, n and w, separated by a space. n represents the number of needles, and w represents the height of the side walls.

The bottom of the box is a 100 × 100 square. The corners of the bottom face are placed at positions (0, 0, 0), (0, 100, 0), (100, 100, 0), and (100, 0, 0).

Each of the n lines following the first line contains three integers, xi, yi, and hi. (xi, yi, 0) and hi represent the base position and the height of the i-th needle. No two needles stand at the same position.

You can assume that 1 ≤ n ≤ 10, 10 ≤ w ≤ 200, 0 < xi < 100, 0 < yi < 100 and 1 ≤ hi ≤ 200. You can ignore the thicknesses of the needles and the walls.

The end of the input is indicated by a line of two zeros. The number of datasets does not exceed 1000.

Output

For each dataset, output a single line containing the maximum radius of a balloon that can touch the bottom of the box without interfering with the side walls or the needles. The output should not contain an error greater than 0.0001.

Example

Input

5 16
70 66 40
38 52 20
40 35 10
70 30 10
20 60 10
1 100
54 75 200
1 10
90 10 1
1 11
54 75 200
3 10
53 60 1
61 38 1
45 48 1
4 10
20 20 10
20 80 10
80 20 10
80 80 10
0 0


Output

26.00000
39.00000
130.00000
49.49777
85.00000
95.00000

Solution (in CPP):

Solution:
#include<bits/stdc++.h>
#define deb(x) cerr<< #x <<" = "<<x<<endl
using namespace std;
const double eps=1e-9;
int sgn(double x){return (x>eps)-(x<-eps);}
int sgn(double a,double b){return sgn(a-b);}
double sqr(double x){return x*x;}
struct P{
	double x,y;
	P(){}
	P(double x,double y):x(x),y(y){}
	double len2(){
		return sqr(x)+sqr(y);
	}
	double len(){
		return sqrt(len2());
	}
	void print(){
		printf("(%.3f,%.3f)\n",x,y);
	}
	P turn90(){return P(-y,x);}
	P norm(){return P(x/len(),y/len());}
};
bool operator==(P a,P b){
	return !sgn(a.x-b.x) and !sgn(a.y-b.y);
}
P operator+(P a,P b){
	return P(a.x+b.x,a.y+b.y);
}
P operator-(P a,P b){
	return P(a.x-b.x,a.y-b.y);
}
P operator*(P a,double b){
	return P(a.x*b,a.y*b);
}
P operator/(P a,double b){
	return P(a.x/b,a.y/b);
}
double operator^(P a,P b){
	return a.x*b.x + a.y*b.y;
}
double operator*(P a,P b){
	return a.x*b.y - a.y*b.x;
}
double det(P a,P b,P c){
	return (b-a)*(c-a);
}
double dis(P a,P b){
	return (b-a).len();
}
double Area(vector<P>poly){
	double ans=0;
	for(int i=1;i<poly.size();i++)
		ans+=(poly[i]-poly[0])*(poly[(i+1)%poly.size()]-poly[0]);
	return fabs(ans)/2;
}
struct L{
	P a,b;
	L(){}
	L(P a,P b):a(a),b(b){}
	P v(){return b-a;}
};
bool onLine(P p,L l){
	return sgn((l.a-p)*(l.b-p))==0;
}
bool onSeg(P p,L s){
	return onLine(p,s) and sgn((s.b-s.a)^(p-s.a))>=0 and sgn((s.a-s.b)^(p-s.b))>=0;
}
bool parallel(L l1,L l2){
	return sgn(l1.v()*l2.v())==0;
}
P intersect(L l1,L l2){
	double s1=det(l1.a,l1.b,l2.a);
	double s2=det(l1.a,l1.b,l2.b);
	return (l2.a*s2-l2.b*s1)/(s2-s1);
}
P project(P p,L l){
	return l.a+l.v()*((p-l.a)^l.v())/l.v().len2();
}
double dis(P p,L l){
	return fabs((p-l.a)*l.v())/l.v().len();
}
struct C{
	P o;
	double r;
	C(){}
	C(P _o,double _r):o(_o),r(_r){}
};
// ?±?????????´????????????
//turn90() P(-y,x)
double fix(double x){return sgn(x)?x:0;}
bool intersect(C a, L l, P &p1, P &p2) { 
	double x = ((l.a - a.o)^ (l.b - l.a)),
		y = (l.b - l.a).len2(),
		d = x * x - y * ((l.a - a.o).len2() - a.r * a.r);
	if (sgn(d) < 0) return false;
	d = max(d, 0.0);
	P p = l.a - ((l.b - l.a) * (x / y)), delta = (l.b - l.a) * (sqrt(d) / y);
	p1 = p + delta, p2 = p - delta;
	return true;
}
// ?±????????????????????????¨????°???¨?????????????????????
bool intersect(C a, C b, P &p1, P &p2) { 
	double s1 = (a.o - b.o).len();
	if (sgn(s1 - a.r - b.r) > 0 || sgn(s1 - fabs(a.r - b.r)) < 0) return false;
	double s2 = (a.r * a.r - b.r * b.r) / s1;
	double aa = (s1 + s2) * 0.5, bb = (s1 - s2) * 0.5;
	P o = (b.o - a.o) * (aa / (aa + bb)) + a.o;
	P delta = (b.o - a.o).norm().turn90() * sqrt(fix(a.r * a.r - aa * aa));
	p1 = o + delta, p2 = o - delta;
	return true;
}
P p[11];
int n,w;
double h[11];
C c[11];
L l[4];
bool check(double r){
	for(int i=1;i<=n;i++){
		c[i].o=p[i];
		if(h[i]-eps>=r){
			c[i].r=r;
		}else{
			c[i].r=sqrt(sqr(r)-sqr(r-h[i]));
		}
	}
	
	double d;
	if(w>=r){
		d=r;
	}else{
		d=sqrt(sqr(r)-sqr(r-w));
	}
	if(d*2+eps>=100)return false;
	static P pt[11111];
	int cnt=0;
	pt[++cnt]=P(d,d);
	pt[++cnt]=P(100-d,d);
	pt[++cnt]=P(d,100-d);
	pt[++cnt]=P(100-d,100-d);
	
	l[0]=L(P(d,d),P(100-d,d));
	l[1]=L(P(100-d,d),P(100-d,100-d));
	l[2]=L(P(100-d,100-d),P(d,100-d));
	l[3]=L(P(d,100-d),P(100-d,d));
	
	for(int i=1;i<=n;i++){
		for(int j=i+1;j<=n;j++){
			P p1,p2;
			if(intersect(c[i],c[j],p1,p2)){
				pt[++cnt]=p1;
				pt[++cnt]=p2;
			}
		}
		
		for(int j=0;j<4;j++){
			P p1,p2;
			if(intersect(c[i],l[j],p1,p2)){
				pt[++cnt]=p1;
				pt[++cnt]=p2;
			}
		}
		
	}
	for(int i=1;i<=cnt;i++){
		int flag=1;
		if(pt[i].x+eps<=d||pt[i].x-eps>=100-d||pt[i].y+eps<=d||pt[i].y-eps>=100-d)
			continue;
		//deb(i);
		//cout<<pt[i].x<<" "<<pt[i].y<<endl;
		for(int j=1;j<=n;j++){
			//deb(dis(pt[i],c[i].o));
			//deb(c[i].r);
			if(sgn(dis(pt[i],c[j].o)-c[j].r)==-1){
				flag=0;
				break;
			}
		}
		if(flag)
			return true;
	}
	return false;
}

int main(){
	while(scanf("%d%d",&n,&w)==2){
		if(!n&&!w)break;
		for(int i=1;i<=n;i++){
			scanf("%lf%lf%lf",&p[i].x,&p[i].y,&h[i]);
		}
		double l=0,r=1e9;
		int TAT=1111;
		//cout<<check(40.0)<<endl;
		//return 0;
		while(TAT--){
			double mid=(l+r)/2;
			if(check(mid))
				l=mid;
			else
				r=mid;
		}
		printf("%.10f\n",l);
	}
	return 0;
}