semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
//******************************************
//*???????.cpp                     **
//*??: ??     1100012808              **
//*???2011.12.07                       **
//******************************************
double d[45];
int n;
void maopaopaixu(double d[])
{
	int i, j;
	double t;
	for (i = 0; i < n * (n - 1) / 2; i++)
	{
		for (j = 0; j < n * (n - 1) / 2 - i; j++)
		{
			if (d[j] < d[j + 1])
			{
				t = d[j];
				d[j] = d[j + 1];
				d[j + 1] = t;
			}
		}
	}
}
int main()  //???
{        //?????
	int i, j, k = 0, flag, a[11][3] = {0}, g[10][10] = {0};
	double b[10][10] = {0.0};
	cin >> n;
	for (i = 0; i < n; i++)
	{
		cin >> a[i][0] >> a[i][1] >> a[i][2];
	}
	for (i = 0; i < n; i++)
	{
		for (j = i + 1; j < n; j++)
		{
			d[k] = sqrt((a[i][1] - a[j][1]) * (a[i][1] - a[j][1]) +
				(a[i][0] - a[j][0]) *(a[i][0] - a[j][0]) +
				(a[i][2] - a[j][2]) * (a[i][2] - a[j][2]));
			b[i][j] = d[k];
			k++;
		}
	}
	maopaopaixu(d);
	for (k = 0; k < n * (n - 1) / 2; k++)
	{
		flag = 0;
		for (i = 0; i < n; i++)
		{
			for (j = i + 1; j < n; j++)
			{
				if (fabs(b[i][j] - d[k]) < 0.00000001 && g[i][j] == 0)
				{
					cout << "(" << a[i][0] << "," <<
						a[i][1] << "," << 
						a[i][2] << ")" << "-" << "(" <<
						a[j][0] << "," <<
						a[j][1] << "," <<
						a[j][2] << ")" << "=" << fixed << 
						setprecision(2) << d[k] << endl;
					flag = 1;
					g[i][j] = 1;
					break;
				}
				
			}
			if (flag)
					break;
		}
	}
	return 0;
} //?????
int main(){
    int n,a,l=0,c,d;
    scanf("%d",&n);
    a=n*(n-1)/2;
    int x[n],y[n],z[n],q[a],p[a];
    double s[a],b;
    for(int i=0;i<n;i++){
        scanf("%d%d%d",&x[i],&y[i],&z[i]);
    }
    for(int i=0;i<n-1;i++){
        for(int k=i+1;k<n;k++){
                s[l]=sqrt((x[i]-x[k])*(x[i]-x[k])+(y[i]-y[k])*(y[i]-y[k])+(z[i]-z[k])*(z[i]-z[k]));
                p[l]=i;
                q[l]=k;
                l++;
            }
        }
    for(int i=1;i<=a;i++){
        for(int k=0;k<a-i;k++){
            if(s[k]<s[k+1]){
                b=s[k];
                s[k]=s[k+1];
                s[k+1]=b;
                c=p[k];
                p[k]=p[k+1];
                p[k+1]=c;
                d=q[k];
                q[k]=q[k+1];
                q[k+1]=d;
            }
        }
    }
    for(int i=0;i<a;i++){
        printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",x[p[i]],y[p[i]],z[p[i]],x[q[i]],y[q[i]],z[q[i]],s[i]);
    }
    return 0;
}
int main()
{

	int n,i,j,a[15],b[15],c[15];
	double d[15][15],z[150],q[150];
	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;j<n;j++){
			d[i][j]=sqrt((a[i]-a[j])*(a[i]-a[j])+
				         (b[i]-b[j])*(b[i]-b[j])+
						 (c[i]-c[j])*(c[i]-c[j]));}}


    
    int t=0;
    for(i=0;i<n;i++){
		for(j=i;j<n;j++){
			z[t]=d[i][j]; t++;}}

	int k;
	double x;

	for(k=t-1;k>0;k--){
		for(i=0;i<k;i++){
			if(z[i]<z[i+1]) {x=z[i]; z[i]=z[i+1]; z[i+1]=x;}}}
	

    int p=0;
	for(i=0;i<150;i++){
		if(z[i]!=z[i+1])  {q[p]=z[i]; p++;}} 


    
	
	
	int y;
	
	for(y=0;q[y]!=0;y++){
	
	for(i=0;i<n;i++){
		for(j=i;j<n;j++){
			if(d[i][j]==q[y]){ 
				printf("(%d,%d,%d)-(%d,%d,%d)",a[i],b[i],c[i],a[j],b[j],c[j]);
			    printf("=");
				printf("%.2lf\n",d[i][j]);}}}}



		

          








   
 













	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,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(double q,double w,double e,double r,double t,double y);

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);
    for(i=0;i<n;i++){
        scanf("%lf%lf%lf",&s[i].j,&s[i].k,&s[i].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=e-1){
	    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;
}

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 n,a[30],b[45],c[45],p=0,e,q,g,i,t,k,s,x,h,j,v;
	double dis[45],mid;
	scanf("%d",&n);
    for(i=0;i<(3*n);i++){
          scanf("%d",&a[i]);
	}
	for(t=0;t<n;t++){
		for(k=t+1;k<n;k++){
		 b[p]=t;c[p]=k;
          e=(a[3*t]-a[3*k])*(a[3*t]-a[3*k])+(a[3*t+1]-a[3*k+1])*(a[3*t+1]-a[3*k+1])+(a[3*t+2]-a[3*k+2])*(a[3*t+2]-a[3*k+2]);
		  dis[p]=sqrt(e);
			  p++;
		}
	}
	for(s=1;s<=p;s++){
		for(x=0;x<p-s;x++){
			if(dis[x]<dis[x+1]){
              mid=dis[x+1];
			  dis[x+1]=dis[x];
			  dis[x]=mid;
			  q=b[x+1];
			  b[x+1]=b[x];
             b[x]=q;
             g=c[x+1];
			 c[x+1]=c[x];
			 c[x]=g;
			}
		}
	}
	for(h=0;h<p;h++){
        j=3*b[h];v=3*c[h];
		
       printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",a[j],a[j+1],a[j+2],a[v],a[v+1],a[v+2],dis[h]);
	}
	return 0;
}
int main()
{
	int n,i,j,k;//??????
	int x[10],y[10],z[10];//?????????
	float d[90]={0},temp=0;//?????????0
	cin>>n;
	for(i=0;i<=n-1;++i)
		cin>>x[i]>>y[i]>>z[i];//????
	for(i=0;i<=n-2;++i)
	{
		for(j=i+1;j<=n-1;++j)
		{
			d[10*i+j]=sqrt((double)((x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j])+(z[i]-z[j])*(z[i]-z[j])));//????
		}
	}
	for(j=1;j<=(n-1)*n/2;++j)//???? ??????
	{
		for(i=1;i<=89;++i)
		{
			if(d[i]==0) continue;//???0 ?????? continue
			if(d[i]>temp)
			{
				temp=d[i];//????
				k=i;
			}
		}
		cout<<"("<<x[k/10]<<","<<y[k/10]<<","<<z[k/10]<<")"<<"-"<<"("<<x[k%10]<<","<<y[k%10]<<","<<z[k%10]<<")"<<"="<<fixed<<setprecision(2)<<temp<<endl;//??
		d[k]=0;//???0
		temp=0;//???0
		k=0;//???0 ??????
	}
	return 0;
}
int main(){
	int i,j,k,m,n,a,b;
	int sz[200] [4];
	scanf("%d",&n);
	double r[200][200],o[100000],e;
	for(i=0;i<n;i++){
		scanf("%d %d %d",&sz[i] [1],&sz[i] [2],&sz[i] [3]);
		}
	for(i=0;i<n;i++){
		for(j=0;j<n;j++){
	
		r[i][j]=sqrt((double)(((sz[i][1])-(sz[j][1]))*((sz[i][1])-(sz[j][1]))+((sz[i][2])-(sz[j][2]))*((sz[i][2])-(sz[j][2]))+((sz[i][3])-(sz[j][3]))*((sz[i] [3])-(sz[j][3]))));
		}
     }
	for(i=0;i<n;i++){
		for(j=0;j<n;j++){
	
		o[(i)*n+j]=r[i][j];

		}
     }
	for(i=1;i<=n*n;i++){
		for(j=1;j<n*n;j++){
			if(o[j]<o[j+1]){
				e=o[j];
				o[j]=o[j+1];
				o[j+1]=e;

			}
		}
	}
	//for(i=1;i<=n*n;i++)cout<<o[i];
	for(i=0;i<n*n;i++){
		if(o[i]==o[i-1])
			continue;
		for(j=0;j<n;j++){
			for(b=j+1;b<n;b++){
				if(o[i+1]==r[j][b]){printf("(%d,%d,%d)",sz[j][1],sz[j][2],sz[j][3]);printf("%c",'-');
				printf("(%d,%d,%d)",sz[b][1],sz[b][2],sz[b][3]);printf("%c",'=');
				printf("%.2lf",r[b][j]);cout<<endl;
				}
			}
		}
	}
    return 0;
}
int main()
{
	int n,i,j,d=1,t,x[12],y[12],z[12];
	float g;
	struct juli
	{
		int a;
		int b;
		float jl;
	}l[100];
	scanf("%d",&n);
	for(i=1;i<=n;i++)
    {
		scanf("%d%d%d",&x[i],&y[i],&z[i]);
	}
	for(i=1;i<=n-1;i++)
	{
		for(j=i+1;j<=n;j++)
		{
			l[d].jl=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]))*1.0);
			l[d].a=i;
			l[d].b=j;
			d++;
		}
	}
	d--;
    for(i=1;i<=d-1;i++)
	{
		for(j=1;j<=d-i;j++)
		{
			if (l[j].jl<l[j+1].jl)
			{
				g=l[j].jl;
				l[j].jl=l[j+1].jl;
				l[j+1].jl=g;
				t=l[j].a;
				l[j].a=l[j+1].a;
				l[j+1].a=t;
				t=l[j].b;
				l[j].b=l[j+1].b;
				l[j+1].b=t;
			}
		}
	}
	for(i=1;i<=d;i++)
	{
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n",x[l[i].a],y[l[i].a],z[l[i].a],x[l[i].b],y[l[i].b],z[l[i].b],l[i].jl);
    }
	return 0;
}
int main()
{
	struct point
	{
		int x;
		int y;
		int z;
	}p[10];                                      //?????
	struct distant
	{
		float d;
		struct point p1;
		struct point p2;
	}dis[45],temp;                                //????
	int n,i,j,k;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d%d%d",&p[i].x,&p[i].y,&p[i].z);
	}
	i=0;
	for(j=0;j<n-1;j++)
	{
		for(k=j+1;k<n;k++)
		{
			dis[i].p1=p[j];
			dis[i].p2=p[k];
			i=i+1;
		}
	}                                              //???????????????????????????
	for(i=0;i<n*(n-1)/2;i++)
	{
		dis[i].d=sqrt((dis[i].p1.x-dis[i].p2.x)*(dis[i].p1.x-dis[i].p2.x)+(dis[i].p1.y-dis[i].p2.y)*(dis[i].p1.y-dis[i].p2.y)+(dis[i].p1.z-dis[i].p2.z)*(dis[i].p1.z-dis[i].p2.z));
	}                                              //?????????
	for(i=1;i<n*(n-1)/2;i++)
	{
		for(j=0;j<n*(n-1)/2-i;j++)
		{
			if(dis[j].d<dis[j+1].d)
			{
				temp=dis[j];
				dis[j]=dis[j+1];
				dis[j+1]=temp;
			}
		}
	}                                                 //??????????????????????????
	for(i=0;i<n*(n-1)/2;i++)
	{
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n",dis[i].p1.x,dis[i].p1.y,dis[i].p1.z,dis[i].p2.x,dis[i].p2.y,dis[i].p2.z,dis[i].d);
	}
	return 0;
}
int main(){
int n,m,i,j,r;
int a[10],b[10],c[10],f[100],g[100],h[100],x[100],y[100],z[100];
double d[100];
scanf("%d",&n);
m=0;
for(i=0;i<n;i++){
scanf("%d%d%d",&a[i],&b[i],&c[i]);}
for(i=n-2;i>=0;i--){
for(j=n-1;j>i;j--){
d[m]=(a[i]-a[j])*(a[i]-a[j])+(b[i]-b[j])*(b[i]-b[j])+(c[i]-c[j])*(c[i]-c[j]);
d[m]=sqrt(d[m]);
f[m]=a[i];
g[m]=b[i];
h[m]=c[i];
x[m]=a[j];
y[m]=b[j];
z[m]=c[j];
m=m+1;}}
for(j=m-1;j>0;j--){
    for(r=0;r<j;r++){
        if(d[r]>d[r+1]){
            double tmp;
            int t1,t2,t3,t4,t5,t6;
            tmp=d[r+1];
            t1=f[r+1];
            t2=g[r+1];
            t3=h[r+1];
            t4=x[r+1];
            t5=y[r+1];
            t6=z[r+1];
            d[r+1]=d[r];
            f[r+1]=f[r]; 
            g[r+1]=g[r];
            h[r+1]=h[r];
            x[r+1]=x[r];
            y[r+1]=y[r];
            z[r+1]=z[r];
            d[r]=tmp;
            f[r]=t1;
            g[r]=t2;
            h[r]=t3;
            x[r]=t4;
            y[r]=t5;
            z[r]=t6;
        }
    }
}
for(i=m-1;i>=0;i--){
 printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",f[i],g[i],h[i],x[i],y[i],z[i],d[i]);
 }
return 0;
}
//************************
//*??????? **
//*?????? **
//*???1200012957 **
//*???2012-12-13 **
//************************

struct point // ???????????????
{
	int x;
	int y;
	int z;
} p[10]; // ?????

struct distance // ???????????????????????????????
{
	int f;
	int b;
	double s;
} a[45];

int main ()
{
	int n, i, j, k = 0;
	cin >> n; // ?????
	for (i = 0; i < n; i++ )
	{
		// ???????
		cin >> p[i].x >> p[i].y >> p[i].z ;
	}
	int m = n * (n - 1) / 2; // ?????????????
	for (i = 0; i < n - 1; i++ )
	{
		for ( j = i + 1; j < n; j++ )
		{
			// ?????????
			a[k].s = sqrt((p[i].x - p[j].x) * (p[i].x - p[j].x) + 
			              (p[i].y - p[j].y) * (p[i].y - p[j].y) + 
			              (p[i].z - p[j].z) * (p[i].z - p[j].z));
			a[k].f = i; // ?????????????
			a[k].b = j;
			k++ ;
		}
	}
	for (i = 0; i < m; i++ )
	{
		k = i;
		for (j = i + 1; j < m; j++ )
		{
			// ??????????
			if (a[k].s < a[j].s)
			{
				k = j;
			}
			else 
			{
				// ?????????????????
				if (a[k].s == a[j].s)
				{
					// ??????????????????????
					if ((a[k].f > a[j].f) ||
						((a[k].f == a[j].f) && (a[k].b > a[j].b)))
					{
						k = j;
					}
				}
			}
		}
		// ??????
		cout << "(" << p[a[k].f].x << "," << p[a[k].f].y << "," << p[a[k].f].z << ")-";
		cout << "(" << p[a[k].b].x << "," << p[a[k].b].y << "," << p[a[k].b].z << ")=";
		cout << setprecision(2) << fixed << a[k].s << endl;
		a[k] = a[i];
	}

	return 0;
}
/*
 * julipaixu.cpp
 *????????n??????10??,??n?????????,???? [ ????]  ???????????????????
 *  Created on: 2013-11-1
 *      Author: 13141
 *
????????????????n??????????????????(??????)?????????0?100????????????????
 *
?????n????????n*(n-1)/2???????????
(x1,y1,z1)-(x2,y2,z2)=??
???????????2??
 */
int main()
{
	int n;
	cin>>n;
	int x[n],y[n],z[n];
	int t=n*(n-1)/2;//CN2 ??
	int d[t];
	int a[t],b[t];//??????????????
	int k=0,i,j;
	for(i=0;i<n;i++)
	{
		cin>>x[i]>>y[i]>>z[i];
	}
	for(i=0;i<n;i++)
	{
		for(j=i+1;j<n;j++)
		{
			d[k]=((x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j])+(z[i]-z[j])*(z[i]-z[j]));//????????
			a[k]=i;
			b[k]=j;
			k++;
		}
	}
	for(int c=1;c<t;c++)
	{
		for(int r=0;r<(k-c);r++)
		{
			if(d[r]<d[r+1])
			{
				swap(d[r],d[r+1]);
				swap(a[r],a[r+1]);
				swap(b[r],b[r+1]);
			}
		}
	}
	for(int w=0;w<t;w++)
	{
		cout<<"("<<x[a[w]]<<","<<y[a[w]]<<","<<z[a[w]]<<")-("<<x[b[w]]<<","<<y[b[w]]<<","<<z[b[w]]<<")="<<fixed<<setprecision(2)<<sqrt(d[w])<<endl;
	}

	return 0;
}
struct distant
{
       int x1;
       int x2;
       float dis;
};
float dist(int x[],int y[])
{
      float d;
      d=(x[0]-y[0])*(x[0]-y[0])+(x[1]-y[1])*(x[1]-y[1])+(x[2]-y[2])*(x[2]-y[2]);
      d=sqrt(d);
      return d;
}
int main()
{
    int n;
    int x[10][3];
    struct distant d[50],temp;
    scanf("%d",&n);
    int i,j,k;
    for(i=0;i<n;i++)
    {
                    for(j=0;j<3;j++)scanf("%d",&x[i][j]);
    }
    for(i=0,k=0;i<n;i++)
    {
                    for(j=i+1;j<n;j++,k++){d[k].x1=i;d[k].x2=j;d[k].dis=dist(x[i],x[j]);}
    }
    for(i=1;i<k;i++)
    {
                    for(j=0;j<k-i;j++)if(d[j].dis<d[j+1].dis){temp=d[j];d[j]=d[j+1];d[j+1]=temp;}
    }
    for(i=0;i<k;i++)printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n",x[d[i].x1][0],x[d[i].x1][1],x[d[i].x1][2],x[d[i].x2][0],x[d[i].x2][1],x[d[i].x2][2],d[i].dis);
}
//Pat.X
int main()
{
	int n;   //????
	int i,j,k,p;    //??????
	int x,y,z;     //?????
	int m;          //????????
	scanf("%d",&n);
	m=n*(n-1)/2;      //????????
	double c[m],t,t0;     //??????????????????
	int a[n][3];   //?????????
	double b[n][n];   //???????????????????????????
	for(i=0;i<n;i++)   //????
	{
		scanf("%d %d %d",&a[i][0],&a[i][1],&a[i][2]);
	}
	k=0;
	for(i=0;i<n-1;i++)        //????
	{
		for(j=i+1;j<n;j++)
		{
			x=a[i][0]-a[j][0];
			y=a[i][1]-a[j][1];
			z=a[i][2]-a[j][2];
			b[i][j]=sqrt(x*x+y*y+z*z);
			c[k]=b[i][j];
			k++;
		}
	}
	for(i=k-1;i>0;i--)   //????
	{
		for(j=0;j<i;j++)
		{
			if(c[j]<c[j+1])
			{
				t=c[j];
				c[j]=c[j+1];
				c[j+1]=t;
			}
		}
	}
	t0=c[0]+1;    //????
	for(i=0;i<k;i++)  //??????
	{
		if(c[i]==t0)
			continue;
		if(c[i]!=t0){   //????????????????????
		t0=c[i];
		for(j=0;j<n-1;j++)
		{
			for(p=j+1;p<n;p++)
			{
				if(b[j][p]==c[i])
				{
					printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",a[j][0],a[j][1],a[j][2],a[p][0],a[p][1],a[p][2],b[j][p]);
				}
			}
		}
		}
	}
	return 0;
}
int main()
{
	struct Distance
	{
		int p1[3];
		int p2[3];
		double length;
	}d[50],temp;
	int n,i,j,k=0;
	cin>>n;
	int point[10][3];
	double result;
	for(i=0;i<n;i++)
		cin>>point[i][0]>>point[i][1]>>point[i][2];
	for(i=0;i<n-1;i++)
		for(j=i+1;j<n;j++)
		{
			d[k].p1[0]=point[i][0];  d[k].p1[1]=point[i][1];	d[k].p1[2]=point[i][2];
			d[k].p2[0]=point[j][0];  d[k].p2[1]=point[j][1];	d[k].p2[2]=point[j][2];
			result=(point[i][0]-point[j][0])*(point[i][0]-point[j][0])+(point[i][1]-point[j][1])*(point[i][1]-point[j][1])+(point[i][2]-point[j][2])*(point[i][2]-point[j][2]);
			d[k].length=sqrt(result*1.0);
			k++;
		}
	for(i=0;i<k-1;i++)
		for(j=0;j<k-1-i;j++)
			if(d[j].length<d[j+1].length) {temp=d[j];d[j]=d[j+1];d[j+1]=temp;}
	for(i=0;i<k;i++)
		cout<<"("<<d[i].p1[0]<<","<<d[i].p1[1]<<","<<d[i].p1[2]<<")"<<"-"<<"("<<d[i].p2[0]<<","<<d[i].p2[1]<<","<<d[i].p2[2]<<")"<<"="<<fixed<<setprecision(2)<<d[i].length<<endl;

		return 0;


}
int main()
{
int n,a[10],b[10],c[10],num1,num2,m[50],l[50];
double d[50],temp,distance;
int i,j,k=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(j=i+1;j<n;j++)
	{
     distance=sqrt(pow((a[i]-a[j]),2)+pow((b[i]-b[j]),2)+pow((c[i]-c[j]),2));
     d[k]=distance;
     m[k]=i;
     l[k]=j;
     k++;
	}

}
for(i=1;i<=n*(n-1)/2;i++){
    for(j=0;j<n*(n-1)/2-i;j++){
        if(d[j]<d[j+1])
		{
         temp=d[j];
         d[j]=d[j+1];
         d[j+1]=temp;
         num1=m[j];
         m[j]=m[j+1];
         m[j+1]=num1;
         num2=l[j];
         l[j]=l[j+1];
         l[j+1]=num2;
		}
	}
}
for(i=0;i<n*(n-1)/2;i++){
printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",a[m[i]],b[m[i]],c[m[i]],a[l[i]],b[l[i]],c[l[i]],d[i]);
}
return 0;
}
int main()
{
	int i,j,k,n,t,a[150],b[150],x[11],y[11],z[11];
	double r,c[150];
	cin>>n;
	for (i=1;i<=n;i++)
				cin>>x[i]>>y[i]>>z[i];
	t=0;
	for (i=1;i<=n-1;i++)
		for (j=i+1;j<=n;j++)
			{
				t++;
				a[t]=i;b[t]=j;
				c[t]=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])
													);
			}
			
			for (i=1;i<=t-1;i++)
				for (j=1;j<=t-i;j++)
					if (c[j+1]>c[j])
						{
							k=a[j+1];a[j+1]=a[j];a[j]=k;
							k=b[j+1];b[j+1]=b[j];b[j]=k;
							r=c[j+1];c[j+1]=c[j];c[j]=r;
					 }
cout<<fixed;
for (i=1;i<=t;i++)
cout<<"("
    <<x[a[i]]<<","<<y[a[i]]<<","<<z[a[i]]
    <<")-("
				<<x[b[i]]<<","<<y[b[i]]<<","<<z[b[i]]
				<<")="
				<<setprecision(2)<<c[i]<<endl;
cin>>i;
	return 0;
}
int main ()
{
	int n=0,p=0,s=0,m=0;			//n?????p????????s??????????m??????????
	cin>>n;
	double t=0;						//t???????????????????double?
	int a[10][3],b[45][6],d[45];	//a????????b?????????????d???b?????
	double c[45];					//c????????

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

	for (int i=0;i<p-1;i++)
		for (int j=0;j<p-1-i;j++)
		{
		  if (c[j]<c[j+1])
			{
				t=c[j];c[j]=c[j+1];c[j+1]=t;
				s=d[j];d[j]=d[j+1];d[j+1]=s;//?????????????????????????????????
			}
		}

	for (int i=0;i<p;i++)
		{   
			m=d[i];
			cout<<"("<<b[m][0]<<","<<b[m][1]<<","<<b[m][2]<<")-("<<b[m][3]<<","<<b[m][4]<<","<<b[m][5]<<")=";
			printf ("%.2f",c[i]);cout<<endl;
		}

	return 0;
}
int main()
	{
int n,i,j,e,c=0,a[10],b[10],d[10];

double s[100],t;
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d%d%d",&a[i],&b[i],&d[i]);
for(i=0;i<n;i++){
    for(j=i+1;j<n;j++){
	s[c]=sqrt(1.0*(a[i]-a[j])*(a[i]-a[j])+1.0*(b[i]-b[j])*(b[i]-b[j])+1.0*(d[i]-d[j])*(d[i]-d[j]));
	c++;
	}
}
for(e=1;e<=n*(n-1)/2;e++){
	for(c=0;c<n*(n-1)/2-e;c++){
		if(s[c]<s[c+1]){
		t=s[c+1];
		s[c+1]=s[c];
		s[c]=t;
		}
	}
}
for(c=0;c<n*(n-1)/2;c++){
	if(s[c]==s[c+1])
		continue;
for(i=0;i<n;i++){
	for(j=i+1;j<n;j++){
		if(s[c]==sqrt(1.0*(a[i]-a[j])*(a[i]-a[j])+1.0*(b[i]-b[j])*(b[i]-b[j])+1.0*(d[i]-d[j])*(d[i]-d[j]))){
			printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",a[i],b[i],d[i],a[j],b[j],d[j],s[c]);
		}
		}
	}
}

return 0;
}
int main()
{
	int geshu;
	cin>>geshu;
	int i,j,xh;
	double a[11][4]={0};
	double b[11][11]={0};
	for(i=1;i<=geshu;i++)cin>>a[i][1]>>a[i][2]>>a[i][3];
	for(i=1;i<geshu;i++)
	{
		for(j=i+1;j<=geshu;j++)
		{
			double m;
			m=(a[i][1]-a[j][1])*(a[i][1]-a[j][1])+(a[i][2]-a[j][2])*(a[i][2]-a[j][2])+(a[i][3]-a[j][3])*(a[i][3]-a[j][3]);
			b[i][j]=sqrt(m);
		}
	}
	int jiayou;
	jiayou=geshu*(geshu-1)/2;
	for(xh=jiayou;xh>=1;xh--)
	{

	  for(i=1;i<geshu;i++)//??????b????????,????.?????????????,????t???,T??n*(n-1)/2???????
	  {
		for(j=i+1;j<=geshu;j++)//??????b[i][j],?????t??xh
		{
			int p,q,t;
			t=0;
			for(p=1;p<geshu;p++)
			{
				for(q=p+1;q<=geshu;q++)
				{
					if(b[i][j]>=b[p][q])t++;
				}
			}
			if(t==xh)
			{
				cout<<"("<<a[i][1]<<","<<a[i][2]<<","<<a[i][3]<<")-("<<a[j][1]<<","<<a[j][2]<<","<<a[j][3]<<")=";			
				printf("%0.2f",b[i][j]);
				cout<<endl;
			}


						
		}
	  }
	}



	return 0;
}
double num[46][8];
struct node 
{
 int a,b,c;
 int  arr[11];
};
 struct node arr[11];
int main()
{ 
	int i,n,j,m;
    struct node  arr[11];
 while(scanf("%d",&n)!=EOF)
 {
  memset(num,0,sizeof(num));
  memset(arr,0,sizeof(arr));
  for(i=0;i<n;i++)
   scanf("%d %d %d",&arr[i].a,&arr[i].b,&arr[i].c);
  int h=0,k=0;
  for(i=0;i<n-1;i++)
   for(j=i+1;j<n;j++)
   {
    double aa,bb,cc,dd;
    aa=pow((double) (arr[i].a-arr[j].a),(int) 2);
    bb=pow((double) (arr[i].b-arr[j].b),(int) 2);
    cc=pow((double) (arr[i].c-arr[j].c),(int) 2);
	dd= sqrt((double)(aa+bb+cc));
    num[h][0]=arr[i].a;
    num[h][1]=arr[i].b;
    num[h][2]=arr[i].c;
    num[h][3]=arr[j].a;
    num[h][4]=arr[j].b;
    num[h][5]=arr[j].c;
    num[h][6]=dd;
    num[h][7]=k;
    k++;
    h++;
   }
    for(i=0;i<h-1;i++)
    for(j=i+1;j<h;j++)
     if(num[i][6]<=num[j][6])
     {
      double d1=0;
      for(m=0;m<=6;m++)
      {
       d1=num[i][m];
       num[i][m]=num[j][m];
       num[j][m]=d1;
      }
	 }
     for(i=0;i<h-1;i++)
      for(j=i+1;j<h;j++)
       if(num[i][6]==num[j][6])
       {
        if(num[i][7]<num[j][7])
        {
         double d1=0;
         for(m=0;m<=7;m++)
         {

          d1=num[i][m];
          num[i][m]=num[j][m];
          num[j][m]=d1;
         }
        }
	   }
       for(i=0;i<h;i++)
        printf("(%.f,%.f,%.f)-(%.f,%.f,%.f)=%.2f\n",num[i][0],num[i][1],num[i][2],num[i][3],
        num[i][4],num[i][5],num[i][6]);
}
 return 0;
}
void swap(int *a,int *b)
{
	int temp;
	temp=*a;
	*a=*b;
	*b=temp;
}
	
void main()
{
	int a[10][3],n,i,j,k=0,b[50][10],N;
	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(j=i+1;j<n;j++)
		{
			b[k][0]=a[i][0];
			b[k][1]=a[i][1];
			b[k][2]=a[i][2];
			b[k][3]=a[j][0];
			b[k][4]=a[j][1];
			b[k][5]=a[j][2];
			b[k++][6]=(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]);
		}
	}
	N=k;
	for(i=1;i<N;i++)
	{
		for(j=0;j<N-i;j++)
		{
			if(b[j][6]<b[j+1][6])
			{
				swap(&b[j][0],&b[j+1][0]);
				swap(&b[j][1],&b[j+1][1]);
				swap(&b[j][2],&b[j+1][2]);
				swap(&b[j][3],&b[j+1][3]);
				swap(&b[j][4],&b[j+1][4]);
				swap(&b[j][5],&b[j+1][5]);
				swap(&b[j][6],&b[j+1][6]);
			}
		}
	}
	for(i=0;i<N;i++)
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n",b[i][0],b[i][1],b[i][2],b[i][3],b[i][4],b[i][5],sqrt(b[i][6]));
}
int main(){
    int n,i,k,a,w,e;
    scanf("%d\n",&n);
    int x[n],y[n],z[n];
    for(i=0;i<n;i++){
        scanf("%d %d %d ",&x[i],&y[i],&z[i]);
    }    
    double r,s,m[n*(n-1)/2],j;
    int p[n*(n-1)/2],q[n*(n-1)/2];
    a=0;
    for(i=0;i<n;i++){
        for(k=i+1;k<n;k++){
        r=sqrt((x[i]-x[k])*(x[i]-x[k])+(y[i]-y[k])*(y[i]-y[k])+(z[i]-z[k])*(z[i]-z[k]));
        m[a]=r;
        p[a]=i;
        q[a]=k;
        a++;
        }
    }
    s=n*(n-1)/2;
    for(i=1;i<s;i++){
        for(a=0;a<s-i;a++){
            if(m[a]<m[a+1]){
                j=m[a];
                m[a]=m[a+1];
                m[a+1]=j;
                w=p[a];
                p[a]=p[a+1];
                p[a+1]=w;
                e=q[a];
                q[a]=q[a+1];
                q[a+1]=e;
            }
        }
    }
    for(a=0;a<s;a++){
        printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",x[p[a]],y[p[a]],z[p[a]],x[q[a]],y[q[a]],z[q[a]],m[a]);
    }
    return 0;
}