#include<iostream>
#include<cmath>

using namespace std;

#define S(X) ((X)*(X))

double dsq(double x,double y,double z,double xx,double yy,double zz){
  return S(xx-x)+S(yy-y)+S(zz-z);
}

int main(){
  for(int n;cin>>n,n;){
    double x[30],y[30],z[30];
    for(int i=0;i<n;i++){
      cin>>x[i]>>y[i]>>z[i];
    }
    double cx=0,cy=0,cz=0;
    double f;
    for(double d=10;d>1e-9;d/=10){
      for(int i=0;i<1000;i++){
	int dx=0;
	for(int j=0;j<n;j++){
	  if(dsq(cx,cy,cz,x[dx],y[dx],z[dx])<dsq(cx,cy,cz,x[j],y[j],z[j])){
	    dx=j;
	  }
	}
	double bx,by,bz;
	bx=x[dx]-cx;
	by=y[dx]-cy;
	bz=z[dx]-cz;
	f=sqrt(S(bx)+S(by)+S(bz));
	cx+=bx*d/f;
	cy+=by*d/f;
	cz+=bz*d/f;
      }
    }
    cout.precision(5);
    cout<<fixed<<f<<endl;
  }
  return 0;
}

