← Home
#include<bits/stdc++.h>
using namespace std;
const int N=1e5+10;
const double eps=1e-8,phi=(3-sqrt(5))/2;
int n;
double s;
struct node{
	int x,y,r;
}a[N];
double calc(double x,double y)
{
	double res=1e9;
	for(int i=1; i<=n; i++)
		res=min(res,a[i].r-sqrt((x-a[i].x)*(x-a[i].x)+(y-a[i].y)*(y-a[i].y)));
	return res;
}
double check(double k)
{
	double l=-1e6,r=1e6,l1=1e9,l2=1e9;
	while(r-l>eps)
	{
		double m1=l+(r-l)*phi,m2=r-(r-l)*phi;
		double x=l1==1e9?calc(k,m1):l1;
		double y=l2==1e9?calc(k,m2):l2;
		if(x>y)r=m2,l1=1e9,l2=x;
		else l=m1,l1=y,l2=1e9;
	}
	s=l;
	return calc(k,l);
}
int main()
{
	cin.tie(0)->sync_with_stdio(0);
	cin>>n;
	for(int i=1; i<=n; i++)cin>>a[i].x>>a[i].y>>a[i].r;
	double l=-1e6,r=1e6,l1=1e9,l2=1e9;
	while(r-l>eps)
	{
		double m1=l+(r-l)*phi,m2=r-(r-l)*phi;
		double x=l1==1e9?check(m1):l1;
		double y=l2==1e9?check(m2):l2;
		if(x>y)r=m2,l1=1e9,l2=x;
		else l=m1,l1=y,l2=1e9;
	}
	cout<<fixed<<setprecision(16)<<l<<' '<<s<<' '<<calc(l,s);
	return 0;
}