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 <iomanip>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
const double EPS = 1e-6;
const double INF = 1e12;
 
struct Point{
    double x,y,z;
    Point(double x, double y, double z):x(x), y(y), z(z){}
    Point(){}
    Point &operator +=(const Point &a){ x+=a.x; y+=a.y; z+=a.z; return *this; }
    Point &operator -=(const Point &a){ x-=a.x; y-=a.y; z-=a.z; return *this; }
    Point &operator *=(const double &a){ x*=a; y*=a; z*=a; return *this; }
    Point operator +(const Point &a) const{ return Point(x+a.x, y+a.y, z+a.z); }
    Point operator -(const Point &a) const{ return Point(x-a.x, y-a.y, z-a.z); }
    Point operator *(const double &a) const{ return Point(a*x, a*y, a*z); }
    Point operator -() { return Point(-x, -y, -z); }
};
 
double dot(const Point &a, const Point &b){
    return a.x*b.x +a.y*b.y +a.z*b.z;
}
Point cross(const Point &a, const Point &b){
    return Point(a.y*b.z -a.z*b.y, a.z*b.x -a.x*b.z, a.x*b.y -a.y*b.x);
}
double abs(const Point &a){
    return sqrt(dot(a, a));
}
Point unit(const Point &a){
    return a *(1/abs(a));
}
bool operator ==(const Point &a, const Point &b){
    return abs(a-b) < EPS;
}

vector<double> solve_linear_equation(vector<vector<double> > a){
    int n = a.size();
    for(int i=0; i<n; i++){
        for(int j=i+1; j<n; j++){
            if(abs(a[j][i]) > abs(a[i][i])){
                swap(a[i], a[j]);
            }
        }
        for(int j=n; j>=i; j--){
            a[i][j] /= a[i][i];
        }
        for(int j=i+1; j<n; j++){
            for(int k=n; k>=i; k--){ 
                a[j][k] -= a[i][k]*a[j][i];
            }
        }
    }
    vector<double> res(n);
    for(int i=n-1; i>=0; i--){
        res[i] = a[i][n];
        for(int j=n-1; j>i; j--){
            res[i] -= a[i][j]*res[j];
        }
    }
    return res;
}

int main(){
    while(1){
        int n;
        cin >> n;
        if(n==0) break;

        vector<Point> p(n);
        for(int i=0; i<n; i++){
            cin >> p[i].x >> p[i].y >> p[i].z;
        }

        vector<Point> cand;
        vector<double> r;
        Point c[4];
        for(int i=0; i<n; i++){
            c[0] = p[i];
            for(int j=i+1; j<n; j++){
                c[1] = p[j];
                for(int k=j+1; k<n; k++){
                    c[2] = p[k];
                    for(int l=k+1; l<n; l++){
                        c[3] = p[l];
                        //4点(連立方程式)
                        vector<vector<double> > mat(3, vector<double>(4));
                        for(int s=0; s<3; s++){
                            mat[s][0] = 2*(c[s].x -c[s+1].x);
                            mat[s][1] = 2*(c[s].y -c[s+1].y);
                            mat[s][2] = 2*(c[s].z -c[s+1].z);
                            mat[s][3] = (c[s].x *c[s].x -c[s+1].x *c[s+1].x)
                                +(c[s].y *c[s].y -c[s+1].y *c[s+1].y)
                                +(c[s].z *c[s].z -c[s+1].z *c[s+1].z);
                        }
                        vector<double> ret = solve_linear_equation(mat);
                        double x = c[0].x -ret[0];
                        double y = c[0].y -ret[1];
                        double z = c[0].z -ret[2];
                        cand.push_back(Point(ret[0], ret[1], ret[2]));
                        r.push_back(sqrt(x*x +y*y +z*z));
                    }
                    //3点(外心のベクトル表示)
                    double sin2[3];
                    for(int i=0; i<3; i++){
                        double A = abs(c[(i+1)%3] -c[(i+2)%3]);
                        double B = abs(c[i] -c[(i+1)%3]);
                        double C = abs(c[i] -c[(i+2)%3]);
                        double cosa = (B*B +C*C -A*A)/(2*B*C);
                        sin2[i] = sin(2*acos(cosa));
                    }
                    Point center = (c[0]*sin2[0] +c[1]*sin2[1] +c[2]*sin2[2])
                        *(1/(sin2[0] +sin2[1] +sin2[2]));
                    cand.push_back(center);
                    r.push_back(abs(center -c[0]));
                }
                //2点(直径)
                cand.push_back((c[0]+c[1]) *0.5);
                r.push_back(abs(c[0]-c[1])/2);
            }
        }

        double ans = INF;
        for(int i=0; i<(int)cand.size(); i++){
            bool ok = true;
            for(int j=0; j<n; j++){
                if(abs(p[j] -cand[i]) > r[i] +EPS){
                    ok = false;
                    break;
                }
            }
            if(ok){
                ans = min(ans, r[i]);
            }
        }
        
        cout << fixed << setprecision(5);
        cout << ans << endl;
    }
    return 0;
}