semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int a[1000];
int b[1000];
int c[1000];
float sum[1000];
float dis[1000];
int x[1000];
int y[1000];
int main(){
  int n=0,d=0,i=0,r=0,l=0,f=0,k=0;
  float e=0;
  for(i=0;i<n;i++){
    sum[i]=0;
    dis[i]=0;
  }
 scanf("%d",&n);
  for(i=0;i<n;i++){
      scanf("%d %d %d ",&a[i],&b[i],&c[i]);
  }
  for(i=0;i<n-1;i++){
      for(r=i+1;r<n;r++){
          sum[l]=(a[i]-a[r])*(a[i]-a[r])+(b[i]-b[r])*(b[i]-b[r])+(c[i]-c[r])*(c[i]-c[r]);
          dis[l]=sqrt(sum[l]);
          x[l]=i;
          y[l]=r;
          l++;}
  }
  for(f=0;f<n*(n-1)/2;f++){
    for(d=0;d<n*(n-1)/2-1; d++){
            if(dis[d]<dis[d+1]){
                e=dis[d];
                dis[d]=dis[d+1];
                dis[d+1]=e;
                                k=x[d];
                                x[d]=x[d+1];
                                x[d+1]=k;
                                k=y[d];
                                y[d]=y[d+1];
                                y[d+1]=k;
            }
    }
   }
  for(f=0;f<n*(n-1)/2;f++){
printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",a[x[f]],b[x[f]],c[x[f]],a[y[f]],b[y[f]],c[y[f]],dis[f]);}
return 0;  
}
int main( ){
    int i,n,k,t,q=0;
    int x[10],y[10],z[10],a[50],b[50];
    double s[50],ss[50],j;
    scanf("%d\n",&n);
    for(i=0;i<n;i++){
    scanf("%d %d %d ",&(x[i]),&(y[i]),&(z[i]));
    }
for(t=0;t<n-1;t++){
    for(i=t+1;i<n;i++){
        s[q]=1.0*(x[t]-x[i])*(x[t]-x[i])+1.0*(y[t]-y[i])*(y[t]-y[i])+1.0*(z[t]-z[i])*(z[t]-z[i]);
        ss[q]=sqrt(s[q]);
        a[q]=t;
        b[q]=i;
        q++;
        }
}
for(k=1;k<=q;k++){
    for(i=0;i<q-k;i++){	
	 	 if(ss[i]<ss[i+1]){	
	 	 	 	 j=ss[i+1];	
	 	 	 	 ss[i+1]=ss[i];	
	 	 	 	 ss[i]=j;
                 j=a[i+1];	
	 	 	 	 a[i+1]=a[i];	
	 	 	 	 a[i]=j;
                 j=b[i+1];	
	 	 	 	 b[i+1]=b[i];	
	 	 	 	 b[i]=j;
	 	 }
    }
}
for(i=0;i<q;i++){
    printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",x[a[i]],y[a[i]],z[a[i]],x[b[i]],y[b[i]],z[b[i]],ss[i]);
}
    return 0;
}
void main()
{
	int n,a[10][3],i,j,x[100][2],k=0,s;
	double d[100],t;
	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d%d%d",&a[i][0],&a[i][1],&a[i][2]);
	for(i=0;i<n-1;i++)
		for(j=i+1;j<n;j++)
		{
			d[k]=sqrt((double)((a[i][0]-a[j][0])*(a[i][0]-a[j][0])+(a[i][1]-a[j][1])*(a[i][1]-a[j][1])+(a[i][2]-a[j][2])*(a[i][2]-a[j][2])));
			x[k][0]=i;x[k][1]=j;
			k++;
		}
	for(i=0;i<k;i++)
		for(j=0;j<k-i-1;j++)
		if(d[j]<d[j+1]) {t=d[j];d[j]=d[j+1];d[j+1]=t;s=x[j][0];x[j][0]=x[j+1][0];x[j+1][0]=s;s=x[j][1];x[j][1]=x[j+1][1];x[j+1][1]=s;}
	for(i=0;i<n*(n-1)/2;i++)
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",a[x[i][0]][0],a[x[i][0]][1],a[x[i][0]][2],a[x[i][1]][0],a[x[i][1]][1],a[x[i][1]][2],d[i]);
}
//********************************
//*???????   **
//*?????? 1300012713 **
//*???2013.12.14  **
//********************************
int main()
{
	int n, b = 0,a[15][3];
	struct distance
	{
		double ds;
		int a1;
		int a2;
	}d[50];
	cin >> n;
	for(int i = 1; i <= n; i++)
		cin >> a[i][0] >> a[i][1] >> a[i][2];
	for(int j = 1; j <= n; j++)
	{
		for(int k = j + 1; k <= n; k++)
		{
			b++;
			d[b].ds = sqrt((a[j][0]-a[k][0])*(a[j][0]-a[k][0])
				+(a[j][1]-a[k][1])*(a[j][1]-a[k][1])
				+(a[j][2]-a[k][2])*(a[j][2]-a[k][2]));
			d[b].a1 = j;
			d[b].a2 = k;
		}
	}
	for(int p = 1; p <= b; p++)
	{
		for(int q = 1; q <= b-p+1; q++)
		{
			if(d[q].ds < d[q+1].ds)
			{
				double b0 = d[q].ds; int b1 = d[q].a1; int b2 = d[q].a2;
				d[q].ds = d[q+1].ds; d[q].a1 = d[q+1].a1; d[q].a2 = d[q+1].a2;
				d[q+1].ds = b0; d[q+1].a1 = b1; d[q+1].a2 = b2;
			}
		}
	}
	for(int l = 1; l <= b; l++)
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n",a[d[l].a1][0],a[d[l].a1][1],a[d[l].a1][2],a[d[l].a2][0],a[d[l].a2][1],a[d[l].a2][2],d[l].ds);
	return 0;
}
int read();
void calculate();
void sort();
double sqr(double p);
int print();
int x[100],y[100],z[100],n;
double a[100][100];
int main()
{
    read();
    calculate();
    print();
    return 0;
}
int read()
{
    int i;
    scanf("%d",&n);
    for (i=1;i<=n;i++)
        scanf ("%d%d%d",&x[i],&y[i],&z[i]);
    return 0;
}
void calculate()
{
    int i,j;
    for (i=1;i<n;i++)
        for (j=i+1;j<=n;j++)
            a[i][j]=sqr((x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j])+(z[i]-z[j])*(z[i]-z[j]));
    return;
}
int print()
{
    int i,j,k,l,p;
    double max;
    p=n*(n-1)/2;
    while (p>0)
    {
        max=-1;
        for (i=1;i<n;i++)
            for(j=n;j>i;j--)
            {
                if (max<a[i][j])
                {
                max=a[i][j];
                 k=i;
                  l=j;
                   }
                 else if (max==a[i][j])
                {
                    if (k>i) {
                        k=i;
                        l=j;
                    }
                    else if (k==i&&l>j)
                    {
                        l=j;
                    }
                }
            }
        printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",x[k],y[k],z[k],x[l],y[l],z[l],a[k][l]);
        a[k][l]=-100;
        p--;
    }
    return 0;
}
double sqr(double p)
{
    double x1,x2;
    x2=p;
    x1=1.0;
    while (fabs(x2-x1)>1e-10)
    {
        x1=x2;
        x2=(x1+p/x1)/2;
    }
    return x2;
}
struct A
{
 int x1,y1,z1;
}a[10];
 
double juli(int a,int b,int c,int d,int e,int f)
{
 double m;
 m=(double)(a-d)*(a-d)+(b-e)*(b-e)+(c-f)*(c-f);
 m=sqrt(m);
 return m;
}
int cmp(const void * a, const void * b)
{
     return((*(double*)a-*(double*)b>0)?1:-1);
}
int main()
{
 int n,i,j,k,l=0,flag;
 double b[50];
 while(cin>>n&&n)//??????
 {
  k=0;
  for(i=0;i<n;i++)//???
  {
   cin>>a[i].x1;
   cin>>a[i].y1;
   cin>>a[i].z1;
  }
   for(i=0;i<n;i++)//???
    for(j=i+1;j<n;j++)
     b[k++]=juli(a[i].x1,a[i].y1,a[i].z1,a[j].x1,a[j].y1,a[j].z1);//???b[i]??
    
    qsort(b,n*(n-1)/2,sizeof(b[0]),cmp);//???? 
    l=n*(n-1)/2-1;
    flag=0;
   while(l>=0)
   {
     for(i=0;i<n;i++)
     {
               for(j=i+1;j<n;j++)      
                if( b[l]==juli(a[i].x1,a[i].y1,a[i].z1,a[j].x1,a[j].y1,a[j].z1))
       {
       //    printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",a[i].x1,a[i].y1,a[i].z1,a[j].x1,a[j].y1,a[j].z1,b[l]);
           cout<<"("<<a[i].x1<<","<<a[i].y1<<","<<a[i].z1<<")"<<"-"<<"("<<a[j].x1<<","<<a[j].y1<<","<<a[j].z1<<")"<<"="<<fixed<<setprecision(2)<<b[l]<<endl;
           l--;
           if(b[l]==b[l+1])
            continue;
           else
           {    flag=1;
             break;
         }
       }
       if(flag==1)
       {
        flag=0;
        break;
       }
     }
     
   }

 }
 return 0;

}
int main()
{
	int i,n,j=1,x[11],y[11],z[11],a,b,k;
	double d[50],t;
	cin>>n;
	for(i=1;i<=n;i++)
		cin>>x[i]>>y[i]>>z[i];
	for(i=1;i<n;i++)
		for(k=i+1;k<=n;k++)
	{
		d[j]=sqrt(pow(x[i]-x[k],2.0)+pow(y[i]-y[k],2.0)+pow(z[i]-z[k],2.0));
		j++;
	}
	for(j=1;j<=(n*(n-1)/2-1);j++)
		for(i=1;i<=(n*(n-1)/2-j);i++)
			if (d[i]<d[i+1])
			{t=d[i];d[i]=d[i+1];d[i+1]=t;}
	for(i=1;i<=(n*(n-1)/2);i++)
	{
		if(d[i]==d[i+1])
			continue;
		for(a=1;a<n;a++)
			for(b=a+1;b<=n;b++)
				if(sqrt(pow(x[a]-x[b],2.0)+pow(y[a]-y[b],2.0)+pow(z[a]-z[b],2.0))==d[i])
					printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n",x[a],y[a],z[a],x[b],y[b],z[b],d[i]);
	}
	return 0;
}
int main()
{
    struct point
    {
        int NO;//????
        double x;double y;double z;//????
        double d[10];//??????
    }points[10];
//??????? ? ???
    struct data
    {
        int num;
        int fromx;int fromy;int fromz;
        int tox;int toy;int toz;
        double dd;
    }result[45+5],temp;
//??????? ?? ???
    int n;
    cin>>n;
//????
    for(int i=0;i<=n-1;i++)
    {
        points[i].NO=i+1;
        cin>>points[i].x>>points[i].y>>points[i].z;
    }
//?????
    int k=0;
    int end;

    for(int i=0;i<=n-2;i++)
        for(int j=i+1;j<=n-1;j++)
            {
                result[++k].dd=points[i].d[j]=sqrt((points[i].x-points[j].x)*(points[i].x-points[j].x)+
                                    (points[i].y-points[j].y)*(points[i].y-points[j].y)+
                                    (points[i].z-points[j].z)*(points[i].z-points[j].z));
                result[k].fromx=(int)points[i].x;
                result[k].fromy=(int)points[i].y;
                result[k].fromz=(int)points[i].z;
                result[k].tox=(int)points[j].x;
                result[k].toy=(int)points[j].y;
                result[k].toz=(int)points[j].z;
                result[k].num=k;
                end=k;
            }
//???????
    for(int i=1;i<=end;i++)
        for(int j=i;j<=end;j++)
            {
                if(result[i].dd<result[j].dd)
                {
                    temp=result[i];
                    result[i]=result[j];
                    result[j]=temp;
                }
            }
//?????????
    for(int i=1;i<=end;i++)
        for(int j=i;j<=end;j++)
            {
                if(result[i].dd==result[j].dd&&result[i].num>result[j].num)
                {
                    temp=result[i];
                    result[i]=result[j];
                    result[j]=temp;
                }
            }
//????????????
    for(int i=1;i<=end;i++)
    {
        cout<<"("<<result[i].fromx<<","<<result[i].fromy<<","<<result[i].fromz<<")-("
                 <<result[i].tox<<","<<result[i].toy<<","<<result[i].toz<<")="
                 <<fixed<<setprecision(2)<<result[i].dd<<endl;
    }
//??
    return 0;
}
struct dist
{
       int x;
       int y;
       int z;
};
main()
{
      struct dist a[11];
      int n;
      scanf("%d",&n);
      int i,j,k;
      for(i=0;i<n;i++)
      {
      scanf("%d %d %d",&a[i].x,&a[i].y,&a[i].z);
      }
      float d[10][10];
      for(i=1;i<=n-1;i++)
      {
      for(j=0;j<i;j++)
      {
                      d[i][j]=sqrt((a[i].x-a[j].x)*(a[i].x-a[j].x)+(a[i].y-a[j].y)*(a[i].y-a[j].y)+(a[i].z-a[j].z)*(a[i].z-a[j].z));
      }
      }
      float t;
      int fx1,fx2,fy1,fy2,fz1,fz2,i0,j0;
      k=n*(n-1)/2;
      while(k!=0)
      {t=0.0;
      for(i=0;i<n;i++)
      {
      for(j=0;j<i;j++)
      {
                      if(d[i][j]>t)
                     { t=d[i][j];i0=i;j0=j;
                       fx1=a[j].x;fy1=a[j].y;fz1=a[j].z;fx2=a[i].x;fy2=a[i].y;fz2=a[i].z;}
                      }
                      }
                      d[i0][j0]=0;
                      printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n",fx1,fy1,fz1,fx2,fy2,fz2,t);
                      k--;
                      }
                      getchar();
                      getchar();
}
int main(){
int n;
int x[1000],y[1000],z[1000],a[100],b[100] ;
double s[1000],c[1000];
scanf("%d",&n);
for(int i=0;i<n;i++){
scanf("%d%d%d",&x[i],&y[i],&z[i]);}
int t=0;
for(int i=0;i<n;i++){
for(int k=i+1;k<n;k++){
s[t]=(x[i]-x[k])*(x[i]-x[k])+(y[i]-y[k])*(y[i]-y[k])+(z[i]-z[k])*(z[i]-z[k]);
a[t]=i;
b[t]=k;
t++;}}
double e;
int r;
for(int i=0;i<t-1;i++){
for(int k=0;k<t-i-1;k++){
if(s[k]<s[k+1]){
                  e=s[k+1];  
s[k+1]=s[k]; 
                 s[k]=e;
r=a[k+1];a[k+1]=a[k];a[k]=r;r=b[k+1];b[k+1]=b[k];b[k]=r;
                }
            }}
for(int i=0;i<t;i++){
c[i]=1.0*sqrt(s[i]);}
for(int i=0;i<t;i++){
printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",x[a[i]],y[a[i]],z[a[i]],x[b[i]],y[b[i]],z[b[i]],c[i]);}
return 0;
}
int main()
{
	int dian[10][3],n,j,i,k;
	int diandui[1000][6];
	double d[1000];
	scanf("%d",&n);
	for(j=0;j<n;j++)
	{
		for(i=0;i<3;i++)
		{
			scanf("%d",&dian[j][i]);
		}
	}
	int p=0;
	for(j=1;j<n;j++)
	{
		for(k=0;k<j;k++)
		{
			int x;
			x=(dian[j][0]-dian[k][0])*(dian[j][0]-dian[k][0])+(dian[j][1]-dian[k][1])*(dian[j][1]-dian[k][1])+(dian[j][2]-dian[k][2])*(dian[j][2]-dian[k][2]);
			d[p]=sqrt(x);
			diandui[p][0]=dian[k][0];
			diandui[p][1]=dian[k][1];
			diandui[p][2]=dian[k][2];
			diandui[p][3]=dian[j][0];
			diandui[p][4]=dian[j][1];
			diandui[p][5]=dian[j][2];
			p++;
			

		}
	}
	int a,b;
	for(k=0;k<p;k++)
	{
		for(i=0;i<p-k-1;i++)
		{
			double t;
			if(d[i]<d[i+1])
			{
				t=d[i];
				d[i]=d[i+1];
				d[i+1]=t;
				for(a=0;a<6;a++)
				{
					b=diandui[i][a];
					diandui[i][a]=diandui[i+1][a];
					diandui[i+1][a]=b;
				}
					
			}
		}
	}
	for(i=0;i<p;i++)
	{
	    printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",diandui[i][0],diandui[i][1],diandui[i][2],diandui[i][3],diandui[i][4],diandui[i][5],d[i]);
		
	}
	return 0;
}
/**
* @file C12Q4.cpp
* @author ???
* @date 2013-12-14
* @description
* ??????:????
*/





typedef struct node
{
	int x,y,z;
}node;

typedef struct distance
{
	node*pn1,*pn2;
	double v;
}dis;



int main()
{
	int n;
	node ns[MAX];
	dis ds[MAX*MAX];
	cin >> n;
	for(int i = 0 ; i < n ; i++)
	{
		cin >> ns[i].x >> ns[i].y >> ns[i].z;
	}
	int p = 0 ; 
	for(int i = 0 ; i < n ; i++)
		for(int j = i+1 ; j < n ; j++)
		{
			ds[p].pn1 = ns+i;
			ds[p].pn2 = ns+j;
			ds[p].v = sqrt((ns[i].x - ns[j].x)*(ns[i].x - ns[j].x)+(ns[i].y - ns[j].y)*(ns[i].y - ns[j].y)
				+(ns[i].z - ns[j].z)*(ns[i].z - ns[j].z));
			p++;
		}
	for(int i = 0 ; i < p ; i++)
	{
		for(int j = p-1; j > i ; j--)
		{
			if (ds[j].v > ds[j-1].v)
			{
				dis tmp = ds[j];
				ds[j] = ds[j-1];
				ds[j-1] = tmp;
			}
		}
	}

	for(int i = 0 ; i < p ; i ++)
	{
		cout << '(' <<ds[i].pn1 ->x << ',' << ds[i].pn1 ->y << ',' << ds[i].pn1 ->z << ')' << '-' ;
		cout << '(' <<ds[i].pn2 ->x << ',' << ds[i].pn2 ->y << ',' << ds[i].pn2 ->z << ')' << '=' ;
		cout << setprecision(2) << fixed <<ds[i].v << endl;
	}
	return 0;
}
int main ()
{int n;
scanf ("%d",&n);
struct dot
{
    int x,y,z;
    double len[9];
}
dots[10];
for (int i1=0;i1<n;i1++)
{
  scanf("%d%d%d",&dots[i1].x,&dots[i1].y,&dots[i1].z);

}
for (int i2=0;i2<n-1;i2++)
{
  for (int i3=n-i2-2;i3>=0;i3--)
  {
      dots[i2].len[n-i2-2-i3]=(dots[i2].x-dots[n-i3-1].x)*(dots[i2].x-dots[n-i3-1].x)+(dots[i2].y-dots[n-i3-1].y)*(dots[i2].y-dots[n-i3-1].y)+(dots[i2].z-dots[n-i3-1].z)*(dots[i2].z-dots[n-i3-1].z);
      dots[i2].len[n-i2-2-i3]=sqrt(dots[i2].len[n-i2-2-i3]);
  }
}

for (int j=0;j<n*(n-1)/2;j++)
{int maxq=0,maxh=0;
double lmax=0.0;
for (int i4=0;i4<n-1;i4++)
{
    for (int i5=0;i5<=n-2-i4;i5++)
    {
        if (dots[i4].len[i5]>lmax){lmax=dots[i4].len[i5];maxq=i4;maxh=i4+i5+1;}
    }

}
printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",dots[maxq].x,dots[maxq].y,dots[maxq].z,dots[maxh].x,dots[maxh].y,dots[maxh].z,dots[maxq].len[maxh-1-maxq]);
dots[maxq].len[maxh-1-maxq]=0;
}
    return 0;
}
int main(){
int n,i,x[100],y[100],z[100],k,t;
double s[1000],e;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d%d%d",&x[i],&y[i],&z[i]);
}
t=0;
for(k=0;k<n;k++){
	for(i=k+1;i<n;i++){
	s[t]=sqrt(1.0*((x[k]-x[i])*(x[k]-x[i])+(y[k]-y[i])*(y[k]-y[i])+(z[k]-z[i])*(z[k]-z[i])));
	t++;
	}
}
for(i=1;i<=n*(n-1)/2;i++){
for(t=0;t<n*(n-1)/2-i;t++){
	if(s[t]<s[t+1]){
	e=s[t];
	s[t]=s[t+1];
	s[t+1]=e;
	}
}
}
for(t=0;t<n*(n-1)/2;t++){
	if(s[t]==s[t+1]){
	continue;
	}else{
		for(k=0;k<n;k++){
			for(i=k+1;i<n;i++){
			if(s[t]==sqrt(1.0*((x[k]-x[i])*(x[k]-x[i])+(y[k]-y[i])*(y[k]-y[i])+(z[k]-z[i])*(z[k]-z[i]))))
				printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",x[k],y[k],z[k],x[i],y[i],z[i],s[t]);

			}
		}
	}
}
return 0;
}
int main(){
 int a[10][3],m,i,j,n,d[45][6],w;
 double b[45],q;
     m=0;
     scanf("%d",&n);
  for(i=0;i<n;i++){
  for(j=0;j<3;j++){
    scanf("%d",&a[i][j]);
 }
}
  for(i=0;i<n-1;i++){
    for(j=i+1;j<n;j++){
      b[m]=sqrt((a[i][0]-a[j][0])*(a[i][0]-a[j][0])+(a[i][1]-a[j][1])*(a[i][1]-a[j][1])+(a[i][2]-a[j][2])*(a[i][2]-a[j][2]));
       d[m][0]=a[i][0];
       d[m][1]=a[i][1];
       d[m][2]=a[i][2];
       d[m][3]=a[j][0];
       d[m][4]=a[j][1];
       d[m][5]=a[j][2];
      m++;
 }
}
  for(i=0;i<m;i++){
     for(j=0;j<m-i-1;j++){
         if(b[j]<b[j+1]){
          q=b[j];
          b[j]=b[j+1];
          b[j+1]=q;
          w=d[j][0];
          d[j][0]=d[j+1][0];
          d[j+1][0]=w;
               w=d[j][1];
               d[j][1]=d[j+1][1];
               d[j+1][1]=w;
                  w=d[j][2];
                  d[j][2]=d[j+1][2];
                  d[j+1][2]=w;
w=d[j][3];
          d[j][3]=d[j+1][3];
          d[j+1][3]=w;
w=d[j][4];
          d[j][4]=d[j+1][4];
          d[j+1][4]=w;
w=d[j][5];
          d[j][5]=d[j+1][5];
          d[j+1][5]=w;
}}}
  for(i=0;i<m;i++){
     printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",d[i][0],d[i][1],d[i][2],d[i][3],d[i][4],d[i][5],b[i]);
}
return 0;
}
struct d
{
    int q[2];  //q ????????
    float dis;  
};
int main()
{
    int n,i,j,k=0,t2[2];
    struct d dist[100];
    float a[10][3],t1;   //?????????a?
    scanf("%d",&n);
    for(i=0;i<n;i++)
        for(j=0;j<3;j++)
            scanf("%f",&a[i][j]);
    for(i=0;i<n;i++)
        for(j=i+1;j<n;j++)
        {
            dist[k].dis=sqrtf( (a[i][0]-a[j][0])*(a[i][0]-a[j][0]) + (a[i][1]-a[j][1])*(a[i][1]-a[j][1]) + (a[i][2]-a[j][2])*(a[i][2]-a[j][2]) );//????
            dist[k].q[0]=i;
            dist[k].q[1]=j;
            k++;
        }
    for(i=0;i<n*(n-1)/2;i++)  //??????????????????
        for(j=n*(n-1)/2-1;j>0;j--)
        {
            if(dist[j-1].dis<dist[j].dis)
            {
                t1=dist[j-1].dis;
                t2[0]=dist[j-1].q[0];
                t2[1]=dist[j-1].q[1];
                dist[j-1].dis=dist[j].dis;
                dist[j-1].q[0]=dist[j].q[0];
                dist[j-1].q[1]=dist[j].q[1];
                dist[j].dis=t1;
                dist[j].q[0]=t2[0];
                dist[j].q[1]=t2[1];
            }
        }
    for(i=0;i<n*(n-1)/2;i++)      printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n",(int)a[dist[i].q[0]][0],(int)a[dist[i].q[0]][1],(int)a[dist[i].q[0]][2],(int)a[dist[i].q[1]][0],(int)a[dist[i].q[1]][1],(int)a[dist[i].q[1]][2],dist[i].dis);
    return 0;
}
double juli(int a,int b,int c,int d,int e,int f)
{
    int x,y,z;
    double sum;
    x=d-a;
    y=e-b;
    z=f-c;
    sum=x*x+y*y+z*z;
    sum=sqrt(sum);
    return sum;
}
int main()
{
    int n,i,j;
    int sz[10][3];
    double distance[45][9];
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        for(j=0;j<3;j++)
        {
            scanf("%d",&sz[i][j]);
        }
        sz[i][3]=i;
    }
    int r=0,k;
    for(i=0;i<n;i++)
    {
        if(i<n-1)
        {
            for(j=i+1;j<n;j++)
            {
                distance[r][0]=sz[i][0];
                distance[r][1]=sz[i][1];
                distance[r][2]=sz[i][2];
                distance[r][3]=sz[i][3];
                distance[r][4]=sz[j][0];
                distance[r][5]=sz[j][1];
                distance[r][6]=sz[j][2];
                distance[r][7]=sz[j][3];
                distance[r][8]=juli(sz[i][0],sz[i][1],sz[i][2],sz[j][0],sz[j][1],sz[j][2]);
                r++;
            }
        }
    }
    for(i=0;i<r;i++)
    {
        for(j=0;j<r-i;j++)
        {
            double c[10];
            if(distance[j][8]<distance[j+1][8])
            {
                for(k=0;k<9;k++)
                {
                    c[k]=distance[j][k];
                }
                for(k=0;k<9;k++)
                {
                    distance[j][k]=distance[j+1][k];
                }
                for(k=0;k<9;k++)
                {
                    distance[j+1][k]=c[k];
                }
                //*c=*distance[j];
                //*distance[j]=*distance[j+1];
                //*distance[j+1]=*c;
            }
        }
    }
    for(i=0;i<r;i++)
    {
        printf("(%.0lf,%.0lf,%.0lf)-(%.0lf,%.0lf,%.0lf)=%.2lf\n",distance[i][0],distance[i][1],distance[i][2],distance[i][4],distance[i][5],distance[i][6],distance[i][8]);
    }
    return 0;
}
int p[100][3];        //????????n?????
struct Distance
{
	int p1,p2;        //????p1?p2???
	double d;
};
int main()
{
	int n;
	cin>>n;
	int i,j,k;
	for(i=0;i<n;i++)
		for(j=0;j<3;j++)
			cin>>p[i][j];
	struct Distance a[100*100+10],temp;      
	int m=0;                                //????m
		for(i=0;i<n;i++)
			for(j=i+1;j<n;j++)                                   
			{	
				double sum=0;
				for(k=0;k<3;k++)
					sum+=pow(p[i][k]*1.0-p[j][k]*1.0,2*1.0);
				a[m].d=sqrt(sum);                               
				a[m].p1=i;                                       //????????????Distance a[m]
				a[m].p2=j;
				m++;
			}
		for(i=0;i<m;i++)                          //????
			for(j=0;j<m-i;j++)
				if(a[j].d<a[j+1].d)
				{
					temp=a[j];
					a[j]=a[j+1];
					a[j+1]=temp;
				}
	for(i=0;i<m;i++)
	{
		
		cout<<"("<<p[a[i].p1][0]<<","<<p[a[i].p1][1]<<","<<p[a[i].p1][2]<<")"<<"-"
		<<"("<<p[a[i].p2][0]<<","<<p[a[i].p2][1]<<","<<p[a[i].p2][2]<<")"<<"="
		<<fixed<<setprecision(2)<<a[i].d<<endl;
	}
	return 0;
}
int main()
{
	struct point
	{
		int x;
		int y;
		int z;
	}p[10];
	struct distance
	{
		int x1,x2;
		int y1,y2;
		int z1,z2;
		double d;
	}d[46],t;
	int n,i,j,k=0,m;
	cin>>n;
	for(i=0;i<n;i++)
	{
		cin>>p[i].x>>p[i].y>>p[i].z;
	}
	for(i=0;i<n-1;i++)
		for(j=i+1;j<n;j++)
		{
			d[k].x1=p[i].x;
			d[k].x2=p[j].x;
			d[k].y1=p[i].y;
			d[k].y2=p[j].y;
			d[k].z1=p[i].z;
			d[k].z2=p[j].z;
			d[k].d=sqrt(((double)d[k].x1-(double)d[k].x2)*((double)d[k].x1-(double)d[k].x2)+((double)d[k].y1-(double)d[k].y2)*((double)d[k].y1-(double)d[k].y2)+((double)d[k].z1-(double)d[k].z2)*((double)d[k].z1-(double)d[k].z2));
			k++;
		}
	m=k;
	struct distance *pointer1,*pointer2;
	pointer1=d;
	pointer2=&t;
	for(i=0;i<m-1;i++)
		for(j=m-1;j>i;j--)
		{
			if((pointer1+j)->d>(pointer1+j-1)->d)
			{
				*pointer2=*(pointer1+j);
				*(pointer1+j)=*(pointer1+j-1);
				*(pointer1+j-1)=*pointer2;
			}
		}
	for(k=0;k<m;k++)
		{	
			cout<<"("<<d[k].x1<<","<<d[k].y1<<","<<d[k].z1<<")"<<"-"<<"("<<d[k].x2<<","<<d[k].y2<<","<<d[k].z2<<")"<<"="
			<<fixed<<setprecision(2)<<d[k].d<<endl;
	}
	return 0;
}
double distance(int b1[],int b2[]);

int main()
{
	int n,i,j,r=0,p,k=0;
	int a[30],b[10][3];
	double d[100][3],temp;
	scanf("%d",&n);
	for(i=0;i<3*n;i++)
		scanf("%d",&a[i]);
    for(i=0;i<n;i++)
	{
		b[i][0]=a[3*i];
		b[i][1]=a[3*i+1];
		b[i][2]=a[3*i+2];
	}
    for(i=0;i<n;i++)
		for(j=i+1;j<n;j++)
		{
			d[k][0]=distance(b[i],b[j]);
			d[k][1]=i;
			d[k][2]=j;
			k++;
		}

	for(i=1;i<k;i++)
		for(j=0;j<k-i;j++)
			if(d[j][0]<d[j+1][0])
			{
				temp=d[j][0];
				d[j][0]=d[j+1][0];
				d[j+1][0]=temp;
				temp=d[j][1];
				d[j][1]=d[j+1][1];
				d[j+1][1]=temp;
				temp=d[j][2];
				d[j][2]=d[j+1][2];
				d[j+1][2]=temp;

			}	
	for(p=0;p<k;p++)
	{
		i=d[p][1];
		j=d[p][2];
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",b[i][0],b[i][1],b[i][2],b[j][0],b[j][1],b[j][2],d[p][0]);
	}
    return 0;                               
}

double distance(int b1[],int b2[])
{
	int X,Y,Z;
	double D;
	X=(b1[0]-b2[0])*(b1[0]-b2[0]);
	Y=(b1[1]-b2[1])*(b1[1]-b2[1]);
	Z=(b1[2]-b2[2])*(b1[2]-b2[2]);
	D=sqrt(X+Y+Z);
	return D;
}
int main()
{
	int n,a[10][3],i,j,k;
	double b[10][10];
	cin>>n;
	for(i=0;i<=n-1;i++)
	 for(j=0;j<=2;j++)
      cin>>a[i][j];
    for(i=0;i<=n-1;i++)
	 for(j=i+1;j<=n-1;j++)
	  b[i][j]=sqrt(pow((double)(a[i][0]-a[j][0]),2)+pow((double)(a[i][1]-a[j][1]),2)+pow((double)(a[i][2]-a[j][2]),2));
	
	 for(k=1;k<=n*(n-1)/2;k++)
	   {
			double r=-1;
			int first,next;
			for(i=0;i<=n-1;i++)
	 			for(j=i+1;j<=n-1;j++){		
				 if(b[i][j]>r){
				  r=b[i][j];
				  first = i;
				  next = j;
				}
			}
		 cout<<"("<<a[first][0]<<","<<a[first][1]<<","<<a[first][2]<<")-("
		<<a[next][0]<<","<<a[next][1]<<","<<a[next][2]<<")="
		<<fixed<<setprecision(2)<<r<<endl;	
		b[first][next] = -9999999;
			}
	 cin>>n;
	 return 0;
	 
      
	}
int main()
{
	int n,i,j,k;
	float x[20],y[20],z[20],d[20][20]={0};
	scanf("%d",&n);
	for(i=1;i<=n;i++)
	{
		scanf("%f%f%f",&x[i],&y[i],&z[i]);

	}
	for(i=1;i<=n;i++)
	{
		for(j=i+1;j<=n;j++)
		{

			d[i][j]=sqrt((x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j])+(z[i]-z[j])*(z[i]-z[j]));
		}
	}
	double count=0;
hell:;
	double max=0;
	int a,b;
	for(i=1;i<=n;i++)
	{
		for(j=i+1;j<=n;j++)
		{
			if(d[i][j]>max)
			{
				max=d[i][j];
				a=i;b=j;
			}
		}
	}
	printf("(%.0f,%.0f,%.0f)-(%.0f,%.0f,%.0f)=%.2lf\n",x[a],y[a],z[a],x[b],y[b],z[b],max);
	d[a][b]=-1;
	count++;
	if(count<(n*(n-1))/2)
	goto hell;
}