semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
/**
* @file 1000012800_3.cpp
* @author ??
* @date 2010-12-15
* @description
* ??????:?????? 
*/

int main()
{
	int n, dot[100][3], count = -1;
	double counter[5000][3], tmp;
	cin >> n;
	for (int i = 0; i < n; i++)
		cin >> dot[i][0] >> dot[i][1] >>  dot[i][2];
	for (int i = 0; i < n - 1; i++)
		for (int j = i + 1; j < n; j++)
		{
			count++;
			counter[count][0] = sqrt((double)((dot[i][0] - dot[j][0]) * (dot[i][0] - dot[j][0]) +
				(dot[i][1] - dot[j][1]) * (dot[i][1] - dot[j][1]) +
				(dot[i][2] - dot[j][2]) * (dot[i][2] - dot[j][2])));
			counter[count][1] = i;
			counter[count][2] = j;
		}
	for (int i = 0; i < count; i++)
		for (int j = count; j > i; j--)
		{
			if (counter[j][0] > counter[j - 1][0])
			{
				for (int k = 0; k < 3; k++)
				{
					tmp = counter[j][k];
					counter[j][k] = counter[j - 1][k];
					counter[j - 1][k] = tmp;
				}
			}
		}
	for (int i = 0; i <= count; i++)
	{
		cout << "(" << dot[(int)counter[i][1]][0] << "," << 
			dot[(int)counter[i][1]][1] << ","  <<dot[(int)counter[i][1]][2] <<
			")-("<< dot[(int)counter[i][2]][0] << "," << dot[(int)counter[i][2]][1] <<
			"," << dot[(int)counter[i][2]][2] << ")=" << setprecision(2) << fixed << counter[i][0] << endl;
	}
	return 0;
}
/*
 * pl.cpp
 *
 *  Created on: 2013-11-2
 *      Author: lenovo
 */

const int maxN=105;
int x[maxN],y[maxN],z[maxN],dis[maxN][maxN],d[maxN*maxN]={0};
int n;
int calc(int a,int b)
{
	return (x[a]-x[b])*(x[a]-x[b])+(y[a]-y[b])*((y[a]-y[b]))+(z[a]-z[b])*(z[a]-z[b]);
}
int main()
{
	int i,j;
	cin>>n;
	for(i=1;i<=n;i++){
		cin>>x[i]>>y[i]>>z[i];
		dis[i][i]=0;
		for(j=1;j<i;j++){
			dis[i][j]=dis[j][i]=calc(i,j);
			d[++d[0]]=dis[i][j];
		}
	}
	sort(d+1,d+d[0]+1);
	d[d[0]+1]=-1;
	for(int k=d[0];k;k--)
		if(d[k]!=d[k+1]){
			for(i=1;i<n;i++)
			    for(j=i+1;j<=n;j++)
			    	if(dis[i][j]==d[k])
			    	   printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n",x[i],y[i],z[i],x[j],y[j],z[j],sqrt(dis[i][j]));
		}
	return 0;
}
double distance(double q,double w,double e,double r,double t,double y)
{
    double u;
    u=sqrt((q-r)*(q-r)+(w-t)*(w-t)+(e-y)*(e-y));
    return u;
}
int main(){
    int a,b,e,f,g,h,n,i;
    double d[10][10],c;
    struct z
    {
        double j;
        double k;
        double l;
    }
    s[10];
    scanf("%d\n",&n);
    for(i=0;i<n-1;i++){
        scanf("%lf%lf%lf ",&s[i].j,&s[i].k,&s[i].l);
    }
    scanf("%lf%lf%lf",&s[n-1].j,&s[n-1].k,&s[n-1].l);
    for(a=0;a<n-1;a++){
        for(b=a+1;b<n;b++){
            d[a][b]=distance(s[a].j,s[a].k,s[a].l,s[b].j,s[b].k,s[b].l);
        }
    }
    for(e=n*(n-1)/2;e>0;e--){
	    for(a=0,c=0;a<n-1;a++){
		    for(b=a+1;b<n;b++){
                if(c<d[a][b]){
				    c=d[a][b];
                    f=a;
					g=b;
				}
			}
		}
    	d[f][g]=0;
        printf("(%.0lf,%.0lf,%.0lf)-(%.0lf,%.0lf,%.0lf)=%.2lf\n",s[f].j,s[f].k,s[f].l,s[g].j,s[g].k,s[g].l,c);
	}
	return 0;
	}
int main()
{int n,i=0,j,p,q;
int a[10][3];
double b[50],k,m;
scanf("%d",&n);
for(i=0;i<n;i++)
{ 
   for(j=0;j<3;j++)
       {scanf("%d",&a[i][j]);}
}
i=0;
  for(p=0;p<n-1;p++)
    { for(q=p+1;q<n;q++)
          {b[i]=1.0*sqrt((a[p][0]-a[q][0])*(a[p][0]-a[q][0])+(a[p][1]-a[q][1])*(a[p][1]-a[q][1])+(a[p][2]-a[q][2])*(a[p][2]-a[q][2]));
          i++;}
     }
int index = i;
for(j=index-1;j>0;j--)
{
    for(i=0;i<j;i++)
        {if(b[i]>b[i+1])
            {k=b[i];
             b[i]=b[i+1];
             b[i+1]=k;
             }
         }
}

b[n*(n-1)/2]=-1;
for(i=n*(n-1)/2;i>=0;i--)
{if(b[i]!=b[i+1])
   {
     for(p=0;p<n;p++)
        { for(q=p+1;q<n;q++)
             {m=1.0*sqrt((a[p][0]-a[q][0])*(a[p][0]-a[q][0])+(a[p][1]-a[q][1])*(a[p][1]-a[q][1])+(a[p][2]-a[q][2])*(a[p][2]-a[q][2]));
                if(m==b[i])
                  {printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",a[p][0],a[p][1],a[p][2],a[q][0],a[q][1],a[q][2],m);}
              }
         }
    }
}
return 0;
}
// ???? ?? 1000062708
int main()
{
	struct num
	{
		int x;
		int y;
		int z;
	}a[10];
	int i, j, k, n, xx, yy;
	double b[10][10], m = 0;
	cin >> n;
	for(i = 0;i < n;i++)
		cin >> a[i].x >> a[i].y >> a[i].z;
	for(i = 0;i < n;i++)
		for(j = i + 1;j < n;j++)
			b[i][j] = sqrt((double)(a[i].x - a[j].x) * (a[i].x - a[j].x) + (double)(a[i].y - a[j].y) * (a[i].y - a[j].y) + (double)(a[i].z - a[j].z) * (a[i].z - a[j].z));
	for(k = 0;k < n * (n - 1) / 2;k++)
	{
		m = 0;
		for(i = 0;i < n;i++)
			for(j = i + 1;j < n;j++)
			{
				if(b[i][j] > m)
				{
					xx = i;
					yy = j;
					m = b[i][j];
				}
			}
		cout << "(" << a[xx].x << "," << a[xx].y << "," << a[xx].z << ")-(" << a[yy].x << "," 
			<< a[yy].y << "," << a[yy].z << ")=" << fixed << setprecision(2) << m <<  endl;
		b[xx][yy] = 0;
	}
	return 0;
}
int main(){
    int n;
    scanf("%d",&n);
    int x[100]={0};
    int y[100]={0};
    int z[100]={0};
    double d[4500]={0};
    int i,j,t,p=0;
    for(i=0;i<n;i++){
        scanf("%d%d%d",&x[i],&y[i],&z[i]);
    }
    int k=0;
    for(i=0;i<n-1;i++){
        for(j=i+1;j<n;j++){
            d[k]=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]));
            k++;
        }
    }
    for(i=0;i<k-1;i++){
        for(j=i+1;j<k;j++){
            if(d[i]<d[j]){
                double tmp;
                tmp=d[i];
                d[i]=d[j];
                d[j]=tmp;
            }
        }
    }
    double a[4500]={0};
    for(i=0;d[i]!=0;i++){
        if(d[i]==d[i+1]){continue;}
        else if(d[i]!=d[i+1]){a[p]=d[i];p++;}
    }
    for(i=0;i<p;i++){
        if(a[i]==0){break;}
        for(j=0;j<n;j++){
            for(t=j+1;t<n;t++){
                if(sqrt((x[t]-x[j])*(x[t]-x[j])+(y[t]-y[j])*(y[t]-y[j])+(z[t]-z[j])*(z[t]-z[j]))==a[i]){
                    printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",x[j],y[j],z[j],x[t],y[t],z[t],a[i]);
                }
            }
        }
    }
    return 0;
}
int main(){
    int x[100],y[100],z[100],n,i,j,k=0,xx[100],yy[100],zz[100],xxx[100],yyy[100],zzz[100];
    double juli[1000];
    scanf("%d",&n);
    for (i=1;i<=n;i++){
        scanf("%d %d %d",&x[i],&y[i],&z[i]);
    }
    for (i=1;i<n;i++){
        for (j=i+1;j<=n;j++){
            k++;
            juli[k]=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]));        
            xx[k]=x[i];
            yy[k]=y[i];
            zz[k]=z[i];
            xxx[k]=x[j];
            yyy[k]=y[j];
            zzz[k]=z[j];
        }
    }
    int a;
    double b;
    for(i=1;i<=k;i++){
        for(j=1;j<=k-i;j++)
            if (juli[j+1]>juli[j]){
               b=juli[j];
               juli[j]=juli[j+1];
               juli[j+1]=b;
               a=xx[j];
               xx[j]=xx[j+1];
               xx[j+1]=a;
               a=yy[j];
               yy[j]=yy[j+1];
               yy[j+1]=a;
               a=zz[j];
               zz[j]=zz[j+1];
               zz[j+1]=a;
               a=xxx[j];
               xxx[j]=xxx[j+1];
               xxx[j+1]=a;
               a=yyy[j];
               yyy[j]=yyy[j+1];
               yyy[j+1]=a;
               a=zzz[j];
               zzz[j]=zzz[j+1];
               zzz[j+1]=a;
            }    
        
    }
    for(i=1;i<=k;i++){
        printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",xx[i],yy[i],zz[i],xxx[i],yyy[i],zzz[i],juli[i]);
    } 
    return 0;
}
int main(){
    int n,i,j,g,k,a[50],b[50],x[10],y[10],z[10],w,q;
    double s[50],e;
    k=-1;
    scanf("%d",&n);
    for(i=0;i<n;i++){
                      scanf("%d %d %d",&x[i],&y[i],&z[i]);
                     
                     }
    for(i=0;i<n-1;i++){
          for(j=i+1;j<n;j++){
                            k++;
                            s[k]= sqrt(pow((x[i]-x[j]),2)+pow((y[i]-y[j]),2)
                            +pow((z[i]-z[j]),2));
                            a[k]=i;
                            b[k]=j;
                            }
           
                            }
   
    for(i=1;i<=n*(n-1)/2;i++){
          for(k=0;k<n*(n-1)/2-i;k++){
                  if(s[k]<s[k+1]){
                      e=s[k];
                      s[k]=s[k+1];
                      s[k+1]=e;
                      g=a[k];
                      a[k]=a[k+1];
                      a[k+1]=g;
                      g=b[k];
                      b[k]=b[k+1];
                      b[k+1]=g;
                      }
                      }
                      }
    
    for(k=0;k<n*(n-1)/2;k++){
        q=a[k];
        w=b[k];
        printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",x[q],y[q],z[q],x[w],y[w],z[w],s[k]);
                                }                                 
                                                          
                                                          
                                                          
                                                          
                                                          
                                                    
return 0;
}
int main()
{
	struct sanD
	{
		int x;
		int y;
		int z;
	}room[10];
	int n, i, j;
	double dis[100];
	double temp;
	int x1[100], x2[100], y1[100], y2[100], z1[100], z2[100];
	int k = 1;
	cin >> n;
	for(i = 0; i < n; i++)
		cin >> room[i].x >> room[i].y >> room[i].z;
	for(i = 0; i < n; i++)
		for(j = i + 1; j < n; j++)
		{
		    x1[k] = room[i].x;
	        y1[k] = room[i].y;
		    z1[k] = room[i].z;
			x2[k] = room[j].x;
			y2[k] = room[j].y;
			z2[k] = room[j].z;
			dis[k] = sqrt((x1[k] - x2[k]) * (x1[k] - x2[k]) + (y1[k] - y2[k]) * (y1[k] - y2[k]) + (z1[k] - z2[k]) * (z1[k] - z2[k]));
			k++;
		}
	for(i = 1; i <= n * (n - 1) / 2; i++)
	{
		for(j = n * (n - 1) / 2; j >= 1 + i	; j--)
		{
            if(dis[j] > dis[j - 1])
			{
				temp = dis[j - 1];
				dis[j - 1] = dis[j];
				dis[j] = temp;
				temp = x1[j - 1];
				x1[j - 1] = x1[j];
				x1[j] = temp;
				temp = x2[j - 1];
				x2[j - 1] = x2[j];
				x2[j] = temp;
				temp = y1[j - 1];
				y1[j - 1] = y1[j];
				y1[j] = temp;
				temp = y2[j - 1];
				y2[j - 1] = y2[j];
				y2[j] = temp;
				temp = z1[j - 1];
				z1[j - 1] = z1[j];
				z1[j] = temp;
				temp = z2[j - 1];
				z2[j - 1] = z2[j];
				z2[j] = temp;
			}
		}
	}
    for(i = 1; i <= n * (n - 1) / 2; i++)
		cout << "(" << x1[i] << "," << y1[i] << "," << z1[i] << ")-(" << x2[i] << "," << y2[i] << "," << z2[i] << ")=" << fixed << setprecision(2) << dis[i] << endl;
	return 0;
}
int main()
{
	int n,m=0,p,q,d;
	double c,e;
	scanf("%d",&n);
	int sz[30];
	int a[45],b[45];
	for(int i=0;i<3*n;i++){
		scanf("%d",&sz[i]);
	}
	double jl[45];
	for(int i=0;i<n-1;i++){
		for(int j=i+1;j<n;j++){
			c=pow(1.0*(sz[3*j]-sz[3*i]),2.0)+pow(1.0*(sz[3*j+1]-sz[3*i+1]),2.0)+pow(1.0*(sz[3*j+2]-sz[3*i+2]),2.0);
			jl[m]=sqrt(c);
			a[m]=i;
			b[m]=j;
			m++;
		}
	}
	for(p=1;p<n*(n-1)/2;p++){
		for(q=0;q<n*(n-1)/2-p;q++){
			if(jl[q]<jl[q+1]){
				e=jl[q];
				jl[q]=jl[q+1];
				jl[q+1]=e;
				d=a[q];
				a[q]=a[q+1];
				a[q+1]=d;
                d=b[q];
				b[q]=b[q+1];
				b[q+1]=d;
			}
		}
	}
	for(p=0;p<n*(n-1)/2;p++){
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",sz[3*a[p]],sz[3*a[p]+1],sz[3*a[p]+2],sz[3*b[p]],sz[3*b[p]+1],sz[3*b[p]+2],jl[p]);
	}
	return 0;
}
int main()
{
	int a[10][3],i,j,k,n,t=0,b[45],c[45],q,m;
	float d[45],p,s;
	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;i++)
	{
		for(k=i+1;k<n;k++)
		{
			s=(a[i][0]-a[k][0])*(a[i][0]-a[k][0])+(a[i][1]-a[k][1])*(a[i][1]-a[k][1])+(a[i][2]-a[k][2])*(a[i][2]-a[k][2]);
			d[t]=sqrt(s);
			b[t]=i;c[t]=k;
			t++;
		}
	}
	for(i=t-1;i>0;i--)
	{
		for(j=t-1;j>t-i-1;j--)
		{
				if(d[j]>d[j-1])
			{
				p=d[j];
				d[j]=d[j-1];
				d[j-1]=p;
				q=b[j];
				b[j]=b[j-1];
				b[j-1]=q;
				q=c[j];
				c[j]=c[j-1];
				c[j-1]=q;
			}
			else;
		}
	}
	for(m=0;m<t;m++)
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n",a[b[m]][0],a[b[m]][1],a[b[m]][2],a[c[m]][0],a[c[m]][1],a[c[m]][2],d[m]);


	return 0;
}
typedef struct Point
{
	int x;
	int y;
	int z;
}Point;                                              //?????????
double Distance(Point *p1,Point *p2)
{
	int x=(p1->x)-(p2->x);
	int y=(p1->y)-(p2->y);
	int z=(p1->z)-(p2->z);
	double temp=(double)(x*x+y*y+z*z);
	return sqrt(temp);
}                                                    //???????
void Input(Point *p[],int n)
{
	int i;
	for(i=0;i<n;i++)
	{
		p[i]=(Point *)malloc(sizeof(Point)); 
		cin>>p[i]->x>>p[i]->y>>p[i]->z;
	}
}                                                    //??n?????
void Output(Point *p1,Point *p2)
{
	printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n\n",p1->x,p1->y,p1->z,p2->x,p2->y,p2->z,Distance(p1,p2));
}
int main()
{
	int n,i,j;
	cin>>n;
    Point *p[15];
    Input(p,n);
    double a[60];
    int k=0;
    for(i=0;i<n;i++)
    {
		for(j=i+1;j<n;j++)
		{	
			int t=0;
			while(t<k+1 &&(a[t]-Distance(p[i],p[j])>0.00001||Distance(p[i],p[j])-a[t]>0.00001))
			{
				t++;
			}
			if(t==k+1)
			{
				a[k]=Distance(p[i],p[j]);  
				k++; 
			}
		}
	}                                               //??????????????a?
    int count=k;                                    //??a????
	for(i=0;i<count;i++)
	{
		for(j=i+1;j<count;j++)
		{
			if(a[i]<a[j])
			{	
				double temp=a[i]; 
				a[i]=a[j]; 
				a[j]=temp;
			}
		}
	}                                              //??a[]??
	k=0;
	while(k<count)
	{
		for(i=0;i<n;i++)
		{
			for(j=i+1;j<n;j++)
			{	
				if(a[k]>Distance(p[i],p[j]))
				{	
					if(a[k]-Distance(p[i],p[j])<0.000001)
						Output(p[i],p[j]);
				}
				else
				{
					if(Distance(p[i],p[j])-a[k]<0.000001)
						Output(p[i],p[j]);
				}
			}
		}
		k++;
	}                                              //?????????????????????????
	return 0;
}
struct Point
{
	int x1;
	int x2;
	int x3;
}point1,point2,p[11];

struct Dis
{
	struct Point point1;
	struct Point point2;
	float d;
}dis[46],tmp;

int main()
{
	int n,i,j,m,k;
	scanf("%d",&n);
	for(i=1;i<=n;i++)
	{
		scanf("%d%d%d",&p[i].x1,&p[i].x2,&p[i].x3);
	}


	for(k=0,m=n-1;m>0;m--)
	{
		
		for(i=1;i<=m;i++)
		{
			dis[k+i].point1=p[n-m];
			dis[k+i].point2=p[n-m+i];
			dis[k+i].d=sqrt((dis[k+i].point1.x1-dis[k+i].point2.x1)*(dis[k+i].point1.x1-dis[k+i].point2.x1)+(dis[k+i].point1.x2-dis[k+i].point2.x2)*(dis[k+i].point1.x2-dis[k+i].point2.x2)+(dis[k+i].point1.x3-dis[k+i].point2.x3)*(dis[k+i].point1.x3-dis[k+i].point2.x3));
		}
		k=k+m;
	}

	for(i=1;i<(n*(n-1)/2);i++)
	{
		for(j=1;j<=(n*(n-1)/2-i);j++)
		{
			if(dis[j].d<dis[j+1].d)
			{
				tmp=dis[j];
				dis[j]=dis[j+1];
				dis[j+1]=tmp;
			}
		}
	}

	for(i=1;i<=n*(n-1)/2;i++)
	{
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n",dis[i].point1.x1,dis[i].point1.x2,dis[i].point1.x3,dis[i].point2.x1,dis[i].point2.x2,dis[i].point2.x3,dis[i].d);
	}
	return 0;
}
struct zuobiao
{
	int x;
	int y;
	int z;
};
struct zuhe
{
	struct zuobiao dian1;
	struct zuobiao dian2;
	double s;
};
double juli(int x3,int y3,int z3,int x4,int y4,int z4)
{
	double d;
	d=(x4-x3)*(x4-x3)+(y4-y3)*(y4-y3)+(z4-z3)*(z4-z3);
	d=sqrt(d);
	return d;
}
int main()
{
	struct zuobiao dian[20];
	struct zuhe zu[100];
	struct zuhe c;
	int n,m,i,j,k=0;
	double l;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d%d%d",&dian[i].x,&dian[i].y,&dian[i].z);
	}
	m=n*(n-1)/2;
	for(i=0;i<m;i++)
	{
		for(j=i+1;j<n;j++)
		{
			l=juli(dian[i].x,dian[i].y,dian[i].z,dian[j].x,dian[j].y,dian[j].z);
			zu[k].dian1=dian[i];
			zu[k].dian2=dian[j];
			zu[k].s=l;
			k++;
		}
	}
	for(i=1;i<m;i++)
	{
		for(j=0;j<m-1;j++)
		{
			if(zu[j].s<zu[j+1].s)
			{
				c=zu[j];
				zu[j]=zu[j+1];
				zu[j+1]=c;
			}
		}
	}
	for(i=0;i<m;i++)
	{
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",zu[i].dian1.x,zu[i].dian1.y,zu[i].dian1.z,zu[i].dian2.x,zu[i].dian2.y,zu[i].dian2.z,zu[i].s);
	}
}
int x[20], y[20], z[20],p[1100];
int main() {
	int i, n, j, plen;
	for (plen = 0, scanf("%d", &n), i = n - 1; i >= 0; i--) {
		scanf("%d%d%d", &x[i], &y[i], &z[i]);
		for (j = n - 1; j > i; j--, plen++)
			p[plen] = ((x[i] - x[j]) * (x[i] - x[j]) + (y[i] - y[j]) * (y[i] - y[j])+ (z[i] - z[j]) * (z[i] - z[j])) * 1000
			           + i * 20 + j;
	}
	for (i=0;i<plen;i++){
		for (j=i+1;j<plen;j++)
			if (p[i]<p[j]){
				n=p[i];
				p[i]=p[j];
				p[j]=n;
			}
	printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n", x[p[i]%20],y[p[i]%20],z[p[i]%20], x[(p[i]%1000)/20],y[(p[i]%1000)/20],z[(p[i]%1000)/20],sqrt(p[i]/1000));
	}
}
/*
 * 1.cpp
 *
 *  Created on: 2012-10-8
 *      Author: Lixurong
 */


int runnian( int a );

int main()
{
	int n, k;//????
	cin >> n;//????
	k = n*(n-1)/2;//????
	double a[n][3];//????
	double b[k][3];//????
	for( int i=0; i<n; i++ )//????
	{
		cin >> a[i][0] >> a[i][1] >> a[i][2];
	}
	int p=0;
	for( int i=0; i<n-1; i++ )//??????
	{
		for( int j=i+1; j<n; j++ )
		{
			b[p][1]=i;
			b[p][2]=j;
			b[p][0]=sqrt(pow((a[i][0]-a[j][0]),2)+pow((a[i][1]-a[j][1]),2)+pow((a[i][2]-a[j][2]),2));
			p++;
		}
	}

	for( int i=0; i<k-1; i++ )//????
	{
		for( int j=0;j<k-1; j++ )
		{
			if( b[j][0]<b[j+1][0] )
			{
				double h=b[j][0];
				b[j][0]=b[j+1][0];
				b[j+1][0]=h;
				int s=(int)b[j][1];
				b[j][1]=b[j+1][1];
				b[j+1][1]=s;
				int e=(int)b[j][2];
				b[j][2]=b[j+1][2];
				b[j+1][2]=e;
			}
		}
	}

	for( int i=0; i<k; i++ )//????
	{
		cout << "(" << fixed << setprecision(0) << a[(int)b[i][1]][0] << "," << a[(int)b[i][1]][1] << "," << a[(int)b[i][1]][2]
		     << ")-(" << a[(int)b[i][2]][0] << "," << a[(int)b[i][2]][1] << "," << a[(int)b[i][2]][2]
		     << ")=" << fixed << setprecision(2) << b[i][0];
		if( i!=k-1 )
			cout << endl;
	}

	return 0;
}
struct dis
{
	int from[4];
	int to[4];
	double d;
}dis[6000];               //???????
int main()
{
	int n,p[11][4],i,j,t=0;
	cin>>n;
	for (i=1;i<=n;i++)
	 for (j=1;j<=3;j++)
	  cin>>p[i][j];      //??????????????
	for (i=1;i<=n-1;i++)
	 for (j=i+1;j<=n;j++)
	 {
	   t++;
	   dis[t].from[1]=p[i][1];
	   dis[t].from[2]=p[i][2];
	   dis[t].from[3]=p[i][3];
	   dis[t].to[1]=p[j][1];
	   dis[t].to[2]=p[j][2];
	   dis[t].to[3]=p[j][3];     //??????????
	   dis[t].d=sqrt(pow(p[i][1]-p[j][1],2.0)+pow(p[i][2]-p[j][2],2.0)+pow(p[i][3]-p[j][3],2.0));//??????????????????
	 }
	for (i=1;i<=t-1;i++)
	 for (j=1;j<=t-i;j++)
	 {
		 if (dis[j].d<dis[j+1].d)
		 {
			 dis[0]=dis[j];
			 dis[j]=dis[j+1];
			 dis[j+1]=dis[0];
		 }                  //????????
	 }
	for (i=1;i<=t;i++)
	{
	 cout<<"("<<dis[i].from[1]<<","<<dis[i].from[2]<<","<<dis[i].from[3]<<")"<<"-";
	 cout<<"("<<dis[i].to[1]<<","<<dis[i].to[2]<<","<<dis[i].to[3]<<")"<<"=";
	 cout<<fixed<<setprecision(2)<<dis[i].d<<endl;                    //?????????

	}
	 return 0;
}
int main(){
    int n,i,j,h;
	double temp;
	double x[30],y[45][7];
	scanf("%d",&n);
	for(i=0;i<3*n;i++){
		scanf("%lf",&(x[i]));	
	}
	h=0;
	for(i=0;i<n-1;i++){
	    for(j=i;j<n-1;j++){
			y[h][0]=x[3*i];
            y[h][1]=x[3*i+1];
		    y[h][2]=x[3*i+2];
		    h++;
		}
	}
	h=0;
	for(i=0;i<n-1;i++){
	    for(j=i+1;j<n;j++){
			y[h][3]=x[3*j];
            y[h][4]=x[3*j+1];
		    y[h][5]=x[3*j+2];
		    y[h][6]=sqrt((y[h][0]-y[h][3])*(y[h][0]-y[h][3])+(y[h][1]-y[h][4])*(y[h][1]-y[h][4])+(y[h][2]-y[h][5])*(y[h][2]-y[h][5]));
			h++;
		}
	}	
	for(i=0;i<(n*(n-1)/2)-1;i++){
	  for(j=0;j<(n*(n-1)/2)-1;j++){
		  if(y[j][6]<y[j+1][6]){
			  for(h=0;h<7;h++){
			      temp=y[j][h];
			      y[j][h]=y[j+1][h];
			      y[j+1][h]=temp;
			  }
		  }
	  }
  }
	for(i=0;i<(n*(n-1)/2);i++){
	    printf("(%.0lf,%.0lf,%.0lf)-(%.0lf,%.0lf,%.0lf)=%.2lf\n",y[i][0],y[i][1],y[i][2],y[i][3],y[i][4],y[i][5],y[i][6]);
	}
	return 0;
}
int main()
{
	int n;
	scanf("%d",&n);
	int i,j,k;
	double sz[100],e;
	struct q{
		int x,y,z;
	}a[100],b[100],c[100],m;
	for(i=0;i<n;i++)
	{
		scanf("%d%d%d",&a[i].x,&a[i].y,&a[i].z);
	}
	int l=0;
	for(i=0;i<n;i++)
	{
		for(j=i+1;j<n;j++)
		  {
              sz[l]=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));
                b[l]=a[i];
			    c[l]=a[j];
				l++;
		}
	}
	for(k=1;k<=l;k++)
	{
		for(i=0;i<l-k;i++)
		{
		   if(sz[i]<sz[i+1])
		   {
		    	e=sz[i];
		    	sz[i]=sz[i+1];
			    sz[i+1]=e;
		    	m=b[i];
		    	b[i]=b[i+1];
		    	b[i+1]=m;
		    	m=c[i];
		    	c[i]=c[i+1];
		    	c[i+1]=m;
		   }
		}
	}
	for(i=0;i<l;i++)
	{
    	printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",b[i].x,b[i].y,b[i].z,c[i].x,c[i].y,c[i].z,sz[i]);
	}
	return 0;
}
/*????  ??*/
struct distance
{
	int x1,y1,z1,x2,y2,z2;
	double s;
}d[45],temp;

int main()
{
	int n,i,j,k,a[10][3];
	cin>>n;
	for(i=0;i<n;i++){
		for(j=0;j<3;j++)
			cin>>a[i][j];}
	k=0;
	while(k<n*(n-1)/2){
		for(i=0;i<n;i++){
			for(j=i+1;j<n;j++){
				d[k].x1=a[i][0];
				d[k].y1=a[i][1];
				d[k].z1=a[i][2];
				d[k].x2=a[j][0];
				d[k].y2=a[j][1];
				d[k].z2=a[j][2];
				d[k].s =sqrt((d[k].x1-d[k].x2)*(d[k].x1-d[k].x2)
					+(d[k].y1-d[k].y2)*(d[k].y1-d[k].y2)
					+(d[k].z1-d[k].z2)*(d[k].z1-d[k].z2));
				k++;}}}
	for(i=0;i<n*(n-1)/2;i++){
		for(j=0;j<n*(n-1)/2-1;j++){
			if(d[j].s<d[j+1].s)
			{temp=d[j];d[j]=d[j+1];d[j+1]=temp;}}}
	for(i=0;i<n*(n-1)/2;i++)
		cout<<"("<<d[i].x1<<","<<d[i].y1<<","<<d[i].z1
			<<")-("<<d[i].x2<<","<<d[i].y2<<","<<d[i].z2<<")="
			<<fixed<<setprecision(2)<<d[i].s<<endl;
	return 0;
}
int main(){
	int x[1000],y[1000],z[1000],n,i,m,j,u[1000],v[1000],c,d;
	double s[100],b;
	b=0;
	c=0;
	d=0;
	m=0;
	scanf("%d",&n);
	for( i=0;i<n;i++)
		scanf("%d%d%d",&x[i],&y[i],&z[i]);
	for(i=0;i<n;i++){
		for(j=n-1;j>i;j--){
			b=(x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j])+(z[i]-z[j])*(z[i]-z[j]);
			s[m]= sqrt(b);
			u[m]=i;
			v[m]=j;
			m++;
		}
	}
	for(i=0;i<n*(n-1)/2;i++){
		if(n==2)
			break;
		for(j=0;j<n*(n-1)/2;j++){
			if(s[j]<s[j+1]){
				b=s[j];
				s[j]=s[j+1];
				s[j+1]=b;
				c=u[j];
				u[j]=u[j+1];
				u[j+1]=c;
				d=v[j];
				v[j]=v[j+1];
				v[j+1]=d;
			}
		}
	}
	for(i=0;i<n*(n-1)/2;i++){
		if(n==2)
			break;
		if(s[i]==s[i+1]){
			if(u[i]>u[i+1]){
				c=u[i];
				u[i]=u[i+1];
				u[i+1]=c;
				d=v[i];
				v[i]=v[i+1];
				v[i+1]=d;
			}
			if(u[i]==u[i+1]){
				if(v[i]>v[i+1]){
					c=u[i];
					u[i]=u[i+1];
					u[i+1]=c;
					d=v[i];
					v[i]=v[i+1];
					v[i+1]=d;
				}
			}
		}
	}
	for(i=0;i<n*(n-1)/2;i++){
		if(n==2)
			printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",x[u[0]],y[u[0]],z[u[0]],x[v[0]],y[v[0]],z[v[0]],s[0]);
		else{
			printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",x[u[i]],y[u[i]],z[u[i]],x[v[i]],y[v[i]],z[v[i]],s[i]);
		}
	}
	return 0;
}
int main()
{
	int a[10][3],m,i,j,k=0,dis[100][2],b[100],temp,x,y,z;
	double distance[100]={0};
	scanf("%d",&m);
	for(i=0;i<m;i++)
	{
		for(j=0;j<3;j++)
		{
			scanf("%d",&a[i][j]);
		}
	}
	for(i=0;i<m;i++)
	{
		for(j=i+1;j<m;j++)
		{
			x=a[i][0]-a[j][0];
			y=a[i][1]-a[j][1];
			z=a[i][2]-a[j][2];
			temp=pow(x,2)+pow(y,2)+pow(z,2);
			distance[k]=sqrt(temp);
			b[k]=k;
			dis[k][0]=i;
			dis[k][1]=j;
			k++;
		}
	}
	for(i=0;i<k;i++)
	{
		for(j=i+1;j<k;j++)
		{
			if(distance[b[i]]<distance[b[j]])
			{
				temp=b[i];
				b[i]=b[j];
				b[j]=temp;
			}
			else if(distance[b[i]]==distance[b[j]])
			{
				if(dis[b[i]][0]>dis[b[j]][0])
				{
					temp=b[i];
					b[i]=b[j];
					b[j]=temp;
				}
				else if(dis[b[i]][0]==dis[b[j]][0]&&dis[b[i]][1]>dis[b[j]][1])
				{
					temp=b[i];
					b[i]=b[j];
					b[j]=temp;
				}
			}
		}
	}
	for(i=0;i<k;i++)
	{
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",a[dis[b[i]][0]][0],a[dis[b[i]][0]][1],a[dis[b[i]][0]][2],a[dis[b[i]][1]][0],a[dis[b[i]][1]][1],a[dis[b[i]][1]][2],distance[b[i]]);
	}
	return 0;
}
double juli(int i1, int i2, int i3, int i4, int i5, int i6);
int main()
{
	int n, i, j, k, q = 0, m;
	double temp;
	int a[100], b[100], c[100], f[100], g[100];
	double e[100];
	scanf("%d", &n);
	for(i = 0; i < n; i++)
	{
		scanf("%d%d%d", &a[i], &b[i], &c[i]);
	}
	for(i = 0; i < n; i++)
	{
		for(j = i+1; j < n; j++)
		{
			 e[q] = juli(a[i], b[i], c[i], a[j], b[j], c[j]);
			 f[q] = i;
			 g[q] = j;
			 q++;
		}
	}
	m = n*(n-1)/2;

	for(k = 1; k <= m; k++)
	{
		for(i = 0; i < m-k; i++)
		{
			if(e[i] < e[i+1])
			{
				temp = e[i+1];
				e[i+1] = e[i];
				e[i] = temp;			
			
				temp = f[i+1];
				f[i+1] = f[i];
				f[i] = temp;			
				
				temp = g[i+1];
				g[i+1] = g[i];
				g[i] = temp;
			}
		}
	}

	for(i = 0; i < m; i++)
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",a[f[i]], b[f[i]], c[f[i]], a[g[i]], b[g[i]], c[g[i]], e[i]);



	return 0;
}
double juli(int i1, int i2, int i3, int i4, int i5, int i6)
{
	double s;
	s = sqrt((i4-i1)*(i4-i1) + (i5-i2)*(i5-i2) + (i6-i3)*(i6-i3));
	return s;
}