Problem: During a voyage of the starship Hakodate-maru (see Problem A), researchers found strange synchronized movements of stars. Having heard these observations, Dr. Extreme proposed a theory of "super stars". Do not take this term as a description of actors or singers. It is a revolutionary theory in astronomy.

According to this theory, stars we are observing are not independent objects, but only small portions of larger objects called super stars. A super star is filled with invisible (or transparent) material, and only a number of points inside or on its surface shine. These points are observed as stars by us.

In order to verify this theory, Dr. Extreme wants to build motion equations of super stars and to compare the solutions of these equations with observed movements of stars. As the first step, he assumes that a super star is sphere-shaped, and has the smallest possible radius such that the sphere contains all given stars in or on it. This assumption makes it possible to estimate the volume of a super star, and thus its mass (the density of the invisible material is known).

You are asked to help Dr. Extreme by writing a program which, given the locations of a number of stars, finds the smallest sphere containing all of them in or on it. In this computation, you should ignore the sizes of stars. In other words, a star should be regarded as a point. You may assume the universe is a Euclidean space.



Input

The input consists of multiple data sets. Each data set is given in the following format.


n
x1 y1 z1
x2 y2 z2
...
xn yn zn


The first line of a data set contains an integer n, which is the number of points. It satisfies the condition 4 ≤ n ≤ 30.

The locations of n points are given by three-dimensional orthogonal coordinates: (xi, yi, zi) (i = 1,..., n). Three coordinates of a point appear in a line, separated by a space character.

Each value is given by a decimal fraction, and is between 0.0 and 100.0 (both ends inclusive). Points are at least 0.01 distant from each other.

The end of the input is indicated by a line containing a zero.

Output

For each data set, the radius ofthe smallest sphere containing all given points should be printed, each in a separate line. The printed values should have 5 digits after the decimal point. They may not have an error greater than 0.00001.

Example

Input

4
10.00000 10.00000 10.00000
20.00000 10.00000 10.00000
20.00000 20.00000 10.00000
10.00000 20.00000 10.00000
4
10.00000 10.00000 10.00000
10.00000 50.00000 50.00000
50.00000 10.00000 50.00000
50.00000 50.00000 10.00000
0


Output

7.07107
34.64102

Solution (in CPP):

Solution:
#include<iostream>
#include<vector>
#include<cmath>

using namespace std;

typedef double elem;

const elem eps = 1.0e-8;
const elem inf = 1.0e20;

bool eq(elem a, elem b){return abs(b-a)<eps;}
bool leq(elem a, elem b){return eq(a,b)||a<b;}

struct point{
  elem x,y,z;
  point(elem x, elem y, elem z):x(x),y(y),z(z){}
  point():x(0),y(0),z(0){}

  const point operator+(const point &t)const{
    return point(x+t.x,y+t.y,z+t.z);
  }
  const point operator-(const point &t)const{
    return point(x-t.x,y-t.y,z-t.z);
  }
  const point operator*(elem t)const{
    return point(t*x,t*y,t*z);
  }
  const point operator/(elem t)const{
    return point(x/t,y/t,z/t);
  }

  elem length()const{
    return sqrt(x*x+y*y+z*z);
  }
  elem dot(const point &t)const{
    return x*t.x+y*t.y+z*t.z;
  }
};

ostream &operator<<(ostream &os, const point &t){
  os << '(' << t.x << ',' << t.y << ',' << t.z << ')';
}
const point far_point(inf,inf,inf);

typedef point vec;

struct sphere{
  point center;
  elem r;
  sphere ():center(0.0,0.0,0.0),r(0.0){}
  sphere (point c, elem r):center(c),r(r){}
  bool inside(const point &t)const{
    //cout << r << ' ' << (t-center).length() << endl;
    return leq( (t-center).length(), r );
  }
};

inline point centerPoint(point a, point b)
{
  return (a+b)/2;
}

inline point circumscribedCircleCenter(point a, point b, point c)
{
  vec va=b-a;
  vec vb=c-a;
  elem A=va.length();
  elem B=vb.length();
  elem C=va.dot(vb)/(A*B);
  elem ds=2*A*pow(C,2.0)-2*A;
  elem dt=2*B*pow(C,2.0)-2*B;
  if( eq(ds,0.0) || eq(dt,0.0) ) return far_point;
  elem s=(B*C-A)/(2*A*pow(C,2.0)-2*A);
  elem t=(A*C-B)/(2*B*pow(C,2.0)-2*B);
  return a+va*s+vb*t;
}

inline point circumscribedTetrahedronCenter(point a, point b, point c, point d)
{
  vec B=b-a;elem la=B.length();
  vec C=c-a;elem lb=C.length();
  vec D=d-a;elem lc=D.length();
  elem delta = B.x*(C.y*D.z-D.y*C.z)+C.x*(D.y*B.z-B.y*D.z)+D.x*(B.y*C.z-C.y*B.z);
  if( eq( delta, 0.0 ) ) return far_point;
  elem x=(B.y*C.z-C.y*B.z)*pow(lc,2.0)+(D.y*B.z-B.y*D.z)*pow(lb,2.0)+(C.y*D.z-D.y*C.z)*pow(la,2.0);
  elem y=(C.x*B.z-B.x*C.z)*pow(lc,2.0)+(B.x*D.z-D.x*B.z)*pow(lb,2.0)+(D.x*C.z-C.x*D.z)*pow(la,2.0);
  elem z=(B.x*C.y-C.x*B.y)*pow(lc,2.0)+(D.x*B.y-B.x*D.y)*pow(lb,2.0)+(C.x*D.y-D.x*C.y)*pow(la,2.0);
  x/=2;y/=2;z/=2;
  return a+point(x,y,z)/delta;
}

elem solve(const vector<point> &vp)
{
  elem answer = inf;
  // nC2
  for(int i = 0; i < vp.size(); ++i){
    for(int j = i + 1; j < vp.size(); ++j){
      bool isContainingBall = true;
      sphere s(centerPoint(vp[i],vp[j]),(vp[i]-vp[j]).length()/2);
      for(int k = 0; k < vp.size(); ++k){
	if( !s.inside( vp[k] ) ){
	  isContainingBall = false;
	  break;
	}
      }
      if( isContainingBall ){
	answer = leq( s.r, answer ) ? s.r : answer;
      }
    }
  }

  // nC3
  for(int i = 0; i < vp.size(); ++i){
    for(int j = i + 1; j < vp.size(); ++j){
      for(int k = j + 1; k < vp.size(); ++k){
	bool isContainingBall = true;
	point cent = circumscribedCircleCenter(vp[i],vp[j],vp[k]);
	sphere s(cent, (vp[i]-cent).length() );
	for(int l = 0; l < vp.size(); ++l){
	  if( !s.inside( vp[l] ) ){
	    isContainingBall = false;
	    break;
	  }
	}
	if( isContainingBall ){
	  answer = leq( s.r, answer ) ? s.r : answer;
	}
      }
    }
  }
  
  // nC4
  for(int i = 0; i < vp.size(); ++i){
    for(int j = i + 1; j < vp.size(); ++j){
      for(int k = j + 1; k < vp.size(); ++k){
	for(int l = k + 1; l < vp.size(); ++l ){
	  bool isContainingBall = true;
	  point cent = circumscribedTetrahedronCenter(vp[i],vp[j],vp[k],vp[l]);
	  sphere s(cent, (vp[i]-cent).length() );
	  //cout << s.center << endl;
	  for(int m = 0; m < vp.size(); ++m){
	    if( !s.inside( vp[m] ) ){
	      isContainingBall = false;
	      break;
	    }
	  }
	  if( isContainingBall ){
	    answer = leq( s.r, answer ) ? s.r : answer;
	  }
	}
      }
    }
  }
  
  return answer;
}

int main()
{
  while(true){
    int n;
    vector<point> vp;

    cin >> n;
    if( n == 0 ) break;

    for(int i = 0; i < n; ++i){
      elem x,y,z;
      cin >> x >> y >> z;
      vp.push_back( point(x,y,z) );
    }
    
    printf("%.7lf\n", solve(vp));

  }
  return 0;
}