/*
  AOJ 2060
  Title:Tetrahedra
  @kankichi573
*/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define max(x,y) (((x)>(y))?(x):(y))
int NN;
double a[15];

is_triangle(double a1,double a2,double a3)
{
  return (a1<a2+a3) && (a2<a3+a1) && (a3<a1+a2);
}

double simen_volume(double a1,double a2,double a3,
		    double a4,double a5,double a6)
{
  double v,a12,a22,a32,a42,a52,a62;

  if(is_triangle(a1,a2,a4) &&
     is_triangle(a2,a3,a5) &&
     is_triangle(a1,a3,a6) &&
     is_triangle(a4,a5,a6))
    {
      a12=a1*a1;
      a22=a2*a2;
      a32=a3*a3;
      a42=a4*a4;
      a52=a5*a5;
      a62=a6*a6;
      v =a12*a52*(a22+a32+a42+a62-a12-a52);
      v+=a22*a62*(a12+a32+a42+a52-a22-a62);
      v+=a32*a42*(a12+a22+a52+a62-a32-a42);
      v-=a12*a22*a42;
      v-=a22*a32*a52;
      v-=a32*a12*a62;
      v-=a42*a52*a62;
      if(v>0.0)
	return(sqrt(v)/12);
      else
	return(0);
    }
  else
    return(0);
}
double simen_volume2(double aa[])
{
  return simen_volume(aa[0],aa[1],aa[2],aa[3],aa[4],aa[5]);
}

double solve(double args[],int count,int used)
{
  int i;
  unsigned int mask;
  double max_,ret,prev,vol;

  //printf(" %d\n",used);
  if(count==6)
    {
      vol=simen_volume2(args);
#ifdef DEBUG
      if(vol!=0.0)
	{
	  for(i=0;i<6;i++)
	    printf("%2.0f:",args[i]);
	  printf("%lf %d\n",vol,used);
	}
#endif
      return(vol);
    }

  max_=0;
  prev=0.0;
  for(i=0,mask=1;i<NN;i++,mask<<=1)
    {
      if((used & mask) ==0)
	{
	args[count]=a[i];
	ret=solve(args,count+1,used|mask);
	max_=max(max_,ret);
	}
    }
  return(max_);
}

main()
{
  int i;
  double ret,args[6];

  while(scanf("%d",&NN)  && (NN   ))
    {
      for(i=0;i<NN;i++)
	scanf("%lf",&a[i]);
      ret=solve(args,0,0);
      printf("%5.7lf\n",ret);
    }
  
  return(0);

}