semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
//**********************************************************
//*  ?????1.cpp                                       *
//*  ??????1200012906                                *
//*  ???2012?12?10?                                  *
//*  ?????????                                    *
//**********************************************************

struct
{
    int id;
	int x1;
	int y1;
	int z1;
	int x2;
	int y2;
	int z2;
	double distance;
}data[55], t;
int main()
{
	int n, x[10], y[10], z[10], i, j, k = 0;
	cin >> n;
	for(i = 0; i < n; i++)
		cin >> x[i] >> y[i] >> z[i];
	for(i = 0; i < n - 1; i++)
		for(j = i + 1; j < n; j++)
		{
			data[k].id = k;
			data[k].x1 = x[i];
			data[k].y1 = y[i];
			data[k].z1 = z[i];
			data[k].x2 = x[j];
			data[k].y2 = y[j];
			data[k].z2 = z[j];
			data[k].distance = pow(x[i] - x[j], 2.0) + pow(y[i] - y[j], 2.0) + pow(z[i] - z[j], 2.0);
			k++;   //k???????????
		}
	for(i = 0; i < k - 1; i++)

		for(j = 0; j < k - i - 1; j++)
		{
			if (data[j].distance < data[j + 1].distance)
			{   //??????
				t = data[j];
				data[j] = data[j + 1];
				data[j + 1] = t;
			}
		}
	for(i = 0; i < k; i++)
	{
		cout << "(" << data[i].x1 << "," << data[i].y1 << "," << data[i].z1 << ")-(";
		cout << data[i].x2 << "," << data[i].y2 << "," << data[i].z2 << ")=";
		cout << fixed << setprecision(2) << sqrt(data[i].distance) << endl;
	}
	return 0;
}
int main()
{
	int b,c,d,h,i,j,k,l,m,n,o,s;
	struct{
		int x,y,z;
	}point[10];
	struct{
		struct{
			int p1,p2,p3;
		}p[50];
		struct{
			int q1,q2,q3;
		}q[50];
		double r;
	}dis[50];
	double g;
	scanf("%d",&n);
	for(int a=0;a<n;a++)
	{
		scanf("%d%d%d",&(point[a].x),&(point[a].y),&(point[a].z));
	}
	s=n*(n-1)/2;
	o=0;
	for(c=0;c<n-1;c++)
	{
			d=c+1;
			for(b=o;b<s;b++)
			{
				dis[b].r=sqrt((point[c].x-point[d].x)*(point[c].x-point[d].x)+(point[c].y-point[d].y)*(point[c].y-point[d].y)+(point[c].z-point[d].z)*(point[c].z-point[d].z));
				dis[b].p[b].p1=point[c].x;
				dis[b].p[b].p2=point[c].y;
				dis[b].p[b].p3=point[c].z;
				dis[b].q[b].q1=point[d].x;
				dis[b].q[b].q2=point[d].y;
				dis[b].q[b].q3=point[d].z;
				d++;
				o++;
				if(d<n)
					continue;
				else
					break;				
			}
	}
	for(int e=1;e<=s;e++)
	{
		for(int f=0;f<s-e;f++)
		{
			if(dis[f].r<dis[f+1].r)
			{
				g=dis[f+1].r;
				dis[f+1].r=dis[f].r;
				dis[f].r=g;
				h=dis[f+1].p[f+1].p1;
				dis[f+1].p[f+1].p1=dis[f].p[f].p1;
				dis[f].p[f].p1=h;
				i=dis[f+1].p[f+1].p2;
				dis[f+1].p[f+1].p2=dis[f].p[f].p2;
				dis[f].p[f].p2=i;
				j=dis[f+1].p[f+1].p3;
				dis[f+1].p[f+1].p3=dis[f].p[f].p3;
				dis[f].p[f].p3=j;
				k=dis[f+1].q[f+1].q1;
				dis[f+1].q[f+1].q1=dis[f].q[f].q1;
				dis[f].q[f].q1=k;
				l=dis[f+1].q[f+1].q2;
				dis[f+1].q[f+1].q2=dis[f].q[f].q2;
				dis[f].q[f].q2=l;
				m=dis[f+1].q[f+1].q3;
				dis[f+1].q[f+1].q3=dis[f].q[f].q3;
				dis[f].q[f].q3=m;
			}
		}
	}
	for(b=0;b<s;b++)
	{
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",dis[b].p[b].p1,dis[b].p[b].p2,dis[b].p[b].p3,dis[b].q[b].q1,dis[b].q[b].q2,dis[b].q[b].q3,dis[b].r);
	}
	return 0;
}
int main()
{
    int spot[11][3],i,j,n,count=0,x,y,z;
    float dis[4951][3],k;
    cin >>n;
    for (i=1;i<=n;i++)
       for (j=0;j<3;j++)
          cin >>spot[i][j];//???? 
    for (i=1;i<n;i++)
       for (j=i+1;j<=n;j++)
          {
             count++;
             x=spot[i][0]-spot[j][0];
             y=spot[i][1]-spot[j][1];
             z=spot[i][2]-spot[j][2];
             dis[count][0]=sqrt(x*x+y*y+z*z);
             dis[count][1]=i;
             dis[count][2]=j;
          }//???????? 
    for (i=1;i<count;i++)
        for (j=1;j<=count-i;j++)
              if (dis[j][0]<dis[j+1][0])
                  {
                      k=dis[j][0];
                      dis[j][0]=dis[j+1][0];
                      dis[j+1][0]=k;
                      k=dis[j][1];
                      dis[j][1]=dis[j+1][1];
                      dis[j+1][1]=k;
                      k=dis[j][2];
                      dis[j][2]=dis[j+1][2];
                      dis[j+1][2]=k;                 
                  }//?? 
    for (i=1;i<=count;i++)
        {
           cout <<"(" <<spot[(int)dis[i][1]][0] <<"," <<spot[(int)dis[i][1]][1] <<"," <<spot[(int)dis[i][1]][2] <<")";
           cout <<"-";
           cout <<"(" <<spot[(int)dis[i][2]][0] <<"," <<spot[(int)dis[i][2]][1] <<"," <<spot[(int)dis[i][2]][2] <<")";
           cout <<"=";
           printf("%.2f",dis[i][0]);
           cout <<endl;          
        }     
    return 0;
}
struct space
{
	float b;
	int x;
	int y;
}
juli[100],cache;
int main()
{
	int a[10][3];
	int i,j,k=0;
	int n;
	scanf("%d",&n);
	scanf("%d %d %d",&a[0][0],&a[0][1],&a[0][2]);
	for(i=1;i<n;i++)
	{
		scanf(" %d %d %d",&a[i][0],&a[i][1],&a[i][2]);
	}
	for(i=0,j=0;;)
	{
		juli[k].x=i;juli[k].y=j;
		juli[k].b=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]));
		k++;
		if(i==n-1&&j==n-1)break;
		if(j==n-1)
		{
			i++;j=0;
		}
		else
			j++;	
	}
	for(i=0;i<n*n;i++)
	{
		for(k=0;k<n*n-i;k++)
		{
			if(juli[k].b<juli[k+1].b)
			{
				cache=juli[k+1];juli[k+1]=juli[k];juli[k]=cache;
			}
		}	
	}
	int a1,a2;
	for(i=0;i<n*n;i++)
	{
		if(juli[i].x>=juli[i].y)
			continue;
		else
		{
			a1=juli[i].x;a2=juli[i].y;
			printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n",a[a1][0],a[a1][1],a[a1][2],a[a2][0],a[a2][1],a[a2][2],juli[i].b);
		}
	}
	return 0;
}
main()
{
    int x[10],y[10],z[10],a1[50],b1[50],c1[50],a2[50],b2[50],c2[50],n,i,j,k,m;
    float d[50],q;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        scanf("%d",&x[i]);
        scanf("%d",&y[i]);
        scanf("%d",&z[i]);
    }
    k=0;
    for(i=0;i<n;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]));
            a1[k]=x[i];
            b1[k]=y[i];
            c1[k]=z[i];
            a2[k]=x[j];
            b2[k]=y[j];
            c2[k]=z[j];
            k++;
        }
    }
    for(i=0;i<(n*(n-1))/2-1;i++)
    {
        for(j=0;j<(n*(n-1))/2-1-i;j++)
        {
            if (d[j]<d[j+1])
            {
                q=d[j+1];
                d[j+1]=d[j];
                d[j]=q;
                m=a1[j+1];
                a1[j+1]=a1[j];
                a1[j]=m;
                m=b1[j+1];
                b1[j+1]=b1[j];
                b1[j]=m;
                m=c1[j+1];
                c1[j+1]=c1[j];
                c1[j]=m;
                m=a2[j+1];
                a2[j+1]=a2[j];
                a2[j]=m;
                m=b2[j+1];
                b2[j+1]=b2[j];
                b2[j]=m;
                m=c2[j+1];
                c2[j+1]=c2[j];
                c2[j]=m;
            }
        }
    }
    for(i=0;i<(n*(n-1))/2;i++)
    {
        printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n",a1[i],b1[i],c1[i],a2[i],b2[i],c2[i],d[i]);
    }
}
int main(){
	int a[10][3];
	int x,y,z,i,j,k,n,f=0;
	scanf("%d",&n);
	double tmp,result[45][3];
	for(i=0;i<n;i++){
		scanf("%d%d%d",&x,&y,&z);
		a[i][0]=x;a[i][1]=y;a[i][2]=z;
	}
    for(i=0;i<n;i++){
		for(j=i+1;j<n;j++){
			result[f][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));
			result[f][1]=i;
			result[f][2]=j;
			f=f+1;
		}
	}
	for(i = 0; i < f; i++){
        for(j = f-1; j >i-1; j--){
		     if(result[j][0] < result[j+1][0]){
		         for(k=0;k<3;k++){
				tmp = result[j+1][k];
				result[j+1][k] = result[j][k];
 				result[j][k] = tmp;
			 }}
		}
	}
	for(i=0;i<f;i++){
		printf("(%d,%d,%d)-",a[(int)result[i][1]][0],a[(int)result[i][1]][1],a[(int)result[i][1]][2]);
	    printf("(%d,%d,%d)=",a[(int)result[i][2]][0],a[(int)result[i][2]][1],a[(int)result[i][2]][2]);
	    printf("%.2f\n",result[i][0]);
	}
	return 0;
}
/*
 * 3.cpp
 *
 *  Created on: 2012-11-3
 *      Author: AK
 */
int main(){
	double a[50][3];                              //???????????????????
	double distance;
	int x[10],y[10],z[10];                         //?????????
	int n,x1,y1,z1,i,j,k=0;                        //?????????
	cin>>n;
	for(i=0;i<n;i++){                             //????????
		cin>>x1>>y1>>z1;
		x[i]=x1;y[i]=y1;z[i]=z1;
	}
	for(i=0;i<=n-2;i++)                            //???????????????????????????
		for(j=i+1;j<=n-1;j++)
		{
			a[k][0]=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]));
			a[k][1]=i;a[k][2]=j;k++;
		}
	for(i=1;i<=k-1;i++)                             //??????????????????????????????????????
		for(j=k-1;j>=i;j--)
		{
			if(a[j][0]>a[j-1][0])
			{
				distance=a[j-1][0];a[j-1][0]=a[j][0];a[j][0]=distance;
				distance=a[j-1][1];a[j-1][1]=a[j][1];a[j][1]=distance;
				distance=a[j-1][2];a[j-1][2]=a[j][2];a[j][2]=distance;
			}
		}
	for(i=0;i<=k-1;i++)              //????      ????????????printf????
	{
		cout<<'('<<x[(int)(a[i][1])]<<','<<y[(int)(a[i][1])]<<','<<z[(int)(a[i][1])]<<")-(";
		cout<<x[(int)(a[i][2])]<<','<<y[(int)(a[i][2])]<<','<<z[(int)(a[i][2])]<<")=";
		cout<<fixed<<setprecision(2)<<a[i][0]<<endl;
	}
	return 0;

}
int main()
{
	int n,i=0,j=0,e=0,m=-1,q=-1;
	double a[100],b[100],c[100],t,g,f,r,v,s,o;
	double d[100],p[100]={0},w[100]={0},k[100]={0},z[100]={0},l[100]={0},u[100]={0};
	cin>>n;
	for(i=0;i<n;i++)
	   cin>>a[i]>>b[i]>>c[i];
	for(i=0;i<n*(n-1)/2;i++)
		d[i]=0;
	e=0;
	for(i=0;i<n-1;i++)
		for(j=i+1;j<n;j++)
			{d[e]=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]));
	          p[e]=a[i];
			  w[e]=a[j];
			   u[e]=b[i];
			  l[e]=b[j];
			  k[e]=c[i];
			  z[e]=c[j];
	         e++;
	}
	for(i=0;i<(n*(n-1)/2)-1;i++)
		for(j=0;j<(n*(n-1)/2)-i-1;j++)
		{	
			if(d[j]<d[j+1])
				{t=d[j];
	            d[j]=d[j+1];
				d[j+1]=t;
			   g=p[j];
	            p[j]=p[j+1];
				p[j+1]=g;
			   f=w[j];
	            w[j]=w[j+1];
				w[j+1]=f;
			   r=u[j];
	            u[j]=u[j+1];
				u[j+1]=r;
			   v=l[j];
	           l[j]=l[j+1];
				l[j+1]=v;
			   s=k[j];
	            k[j]=k[j+1];
				k[j+1]=s;
			  o=z[j];
	            z[j]=z[j+1];
				z[j+1]=o;}
		}
			for(i=0;i<(n*(n-1)/2);i++)
			{cout<<"("<<p[i]<<","<<u[i]<<","<<k[i]<<")"<<"-"<<"("<<w[i]<<","<<l[i]<<","<<z[i]<<")"<<"=";
			printf("%.2f\n",d[i]);
			
			}
		}
int main(){
	int x[10],y[10],z[10],n,i,j,c,maxi,maxj;
	float s[10][10],max;
	max=0.0f;
	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++){
			s[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]));
		}
	}
	for(c=0;c<(n*(n-1)/2);c++){
	    for(i=0;i<n-1;i++){
		    for(j=i+1;j<n;j++){
				if(s[i][j]>max){
					max=s[i][j];
					maxi=i;
					maxj=j;
				}
			}
		}
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n",x[maxi],y[maxi],z[maxi],x[maxj],y[maxj],z[maxj],max);
		s[maxi][maxj]=0.0f;
		max=0.0f;
		maxi=i;
		maxj=j;
	}
	return 0;
}
int main(){
int n;
int x[10],y[10],z[10], q=0,a[100],b[100],c[100],d[100],e[100],f[100];
float t,m[100];
scanf("%d",&n);
for(int h=0;h<n;h++){

	scanf("%d%d%d",&x[h],&y[h],&z[h]);
}
for(int i=0;i<n;i++){
	for(int u=i+1;u<n;u++){
    m[q] =(float)sqrt((x[i]-x[u])*(x[i]-x[u])+(y[i]-y[u])*(y[i]-y[u])+(z[i]-z[u])*(z[i]-z[u]));
	a[q]=x[i];b[q]=y[i];c[q]=z[i];d[q]=x[u];e[q]=y[u];f[q]=z[u];
	q++;
	}
}

for(int r=0;r<q;r++){
	for(int k=0;k<q-r;k++){
		if(m[k]<m[k+1]){
		t=m[k+1];
		m[k+1]=m[k];
		m[k]=t;
		t=a[k+1];
		a[k+1]=a[k];
		a[k]=t;
		t=b[k+1];
		b[k+1]=b[k];
		b[k]=t;		
		t=c[k+1];
		c[k+1]=c[k];
		c[k]=t;		
        t=d[k+1];
		d[k+1]=d[k];
		d[k]=t;
        t=e[k+1];
		e[k+1]=e[k];
		e[k]=t;
        t=f[k+1];
		f[k+1]=f[k];
		f[k]=t;
		
		
		}	
	}
}
for(int w=0;w<q;w++)
{printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n",a[w],b[w],c[w],d[w],e[w],f[w],m[w]);}
return 0;
}
int main(){
int x[10],y[10],z[10];
int n,i;
scanf("%d",&n);
int max,k=0;
max=n*(n-1)/2;
int MAX[45*45],MAX2[45*45];
int c;
double di[45][45],sz[45]={0.00};
for(i=0;i<n;i++){
scanf("%d%d%d",&x[i],&y[i],&z[i]);
}
for(i=0;i<n-1;i++){
	for(k=1;k+i<n;k++){
		di[i][i+k]=sqrt((x[i]-x[i+k])*(x[i]-x[i+k])+(y[i]-y[i+k])*(y[i]-y[i+k])+(z[i]-z[i+k])*(z[i]-z[i+k]));}
}
for(c=0;c<max;c++){for(i=0;i<n-1;i++){
	for(k=1;k+i<n;k++){if(c==0){if(sz[c]<di[i][i+k]){MAX[c]=i;MAX2[c]=i+k;sz[c]=di[i][i+k];}}
	else if(sz[c]<di[i][i+k]&&di[i][i+k]<sz[c-1]){MAX[c]=i;MAX2[c]=i+k;sz[c]=di[i][i+k];}
	else if(sz[c]<di[i][i+k]&&di[i][i+k]==sz[c-1]){if(i>MAX[c-1]){MAX[c]=i;MAX2[c]=i+k;sz[c]=di[i][i+k];}else if(i==MAX[c-1]){if(i+k>MAX2[c-1]){MAX[c]=i;MAX2[c]=i+k;sz[c]=di[i][i+k];}}
	}}}}
for(c=0;c<max;c++){printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",x[MAX[c]],y[MAX[c]],z[MAX[c]],x[MAX2[c]],y[MAX2[c]],z[MAX2[c]],sz[c]);}
return 0;
}
int main()
{
	int n,i,k,j=0,m,f,g;
	scanf("%d",&n);
	int s[10][3],b[50][3],d[50][3];
	double c[50],r,e;
	for(i=0;i<n;i++){
		for(k=0;k<3;k++){
			scanf("%d",&s[i][k]);
		}
	}
	for(i=0;i<n;i++){
		for(k=i+1;k<n;k++){
			r=sqrt((s[i][0]-s[k][0])*(s[i][0]-s[k][0])+(s[i][1]-s[k][1])*(s[i][1]-s[k][1])+(s[i][2]-s[k][2])*(s[i][2]-s[k][2]));
			b[j][0]=s[i][0];
			b[j][1]=s[i][1];
			b[j][2]=s[i][2];
			d[j][0]=s[k][0];
			d[j][1]=s[k][1];
			d[j][2]=s[k][2];
			c[j]=r;
			j++;
		}
	}
	for(i=1;i<n*(n-1)/2;i++){
		for(k=0;k<n*(n-1)/2-i;k++){
			if(c[k]<c[k+1]){
				e=c[k+1];
				c[k+1]=c[k];
				c[k]=e;
				for(m=0;m<3;m++){
					f=b[k+1][m];
					b[k+1][m]=b[k][m];
					b[k][m]=f;
					g=d[k+1][m];
					d[k+1][m]=d[k][m];
					d[k][m]=g;
				}
			}
		}
	}
	for(i=0;i<n*(n-1)/2;i++){
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",b[i][0],b[i][1],b[i][2],d[i][0],d[i][1],d[i][2],c[i]);
	}
	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(int 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;
}
/*
 * jiegou_4.cpp
 * ???????
 *  Created on: 2011-1-2
 *      Author: Wang Ju
 */

struct distance       //?????distance
{
	double a[3];     //??1
	double b[3];     //??2
	double distance;      //???????
};                    
int factorial(int i)       //????facortial,??i?????????
{
	return (i*(i+1))/2; 
}
double oper(double x1, double y1, double z1, double x2, double y2, double z2)
{
	return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)+(z1-z2)*(z1-z2)); 
//????oper,???????
}
int main()        //????
{
	int n, i, j, m;       //????
	cin>>n;     //??????n
	double x[n][3];
	for(i=0; i<n; i++)
	{
		cin>>x[i][0]>>x[i][1]>>x[i][2]; //????
	}
	m=factorial(n-1);//m?distance???
	struct distance dot[m]; //??m?distance??
	int k=0;
	for(i=1; i<n; i++)
		for(j=i+1; j<=n; j++)
		{
			dot[k].a[0]=x[i-1][0];
			dot[k].a[1]=x[i-1][1];
			dot[k].a[2]=x[i-1][2];
			dot[k].b[0]=x[j-1][0];
			dot[k].b[1]=x[j-1][1];
			dot[k].b[2]=x[j-1][2];
			dot[k].distance=oper(dot[k].a[0], dot[k].a[1], dot[k].a[2], dot[k].b[0], dot[k].b[1], dot[k].b[2]);
			k++; 
//?????????????????????????
		}
    for(i=0; i<m-1; i++)
    	for(j=0; j<m-i-1; j++)
    	{
    		if(dot[j].distance<dot[j+1].distance)
    		{
    			struct distance temp=dot[j];
    			dot[j]=dot[j+1];
    			dot[j+1]=temp; //?????
    		}                    
    	}
    for(i=0; i<m; i++)
    {
    	cout<<fixed<<setprecision(0)<<"("<<dot[i].a[0]<<","<<dot[i].a[1]<<","<<dot[i].a[2]<<")-("<<dot[i].b[0]<<
    	    ","<<dot[i].b[1]<<","<<dot[i].b[2]<<")=";
    	cout<<fixed<<setprecision(2)<<dot[i].distance<<endl;
    }     //???????????
    return 0;        //???0?
}
main()
{
    int a[10],b[10],c[10];
	int i,j,k,n,t;
	float w;
	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d %d %d",&a[i],&b[i],&c[i]);
    struct px
	{
	    float d;
		int p,q,r;
		int x,y,z;

	};
	struct px m[45];
	k=0;
	for(i=0;i<n;i++)
	{
		for(j=i+1;j<n;j++)
		{
		    m[k].d=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]));
			m[k].p=a[i];
			m[k].q=b[i];
			m[k].r=c[i];
			m[k].x=a[j];
			m[k].y=b[j];
			m[k++].z=c[j];
		}
	}
	for(i=0;i<n*(n-1)/2-1;i++)
	{
		for(j=0;j<n*(n-1)/2-i;j++)
		{
			if(m[j].d<m[j+1].d)
			{
			    w=m[j].d;
				m[j].d=m[j+1].d;
				m[j+1].d=w;

				t=m[j].p;
				m[j].p=m[j+1].p;
				m[j+1].p=t;

				t=m[j].q;
				m[j].q=m[j+1].q;
				m[j+1].q=t;

				t=m[j].r;
				m[j].r=m[j+1].r;
				m[j+1].r=t;

				t=m[j].x;
				m[j].x=m[j+1].x;
				m[j+1].x=t;

				t=m[j].y;
				m[j].y=m[j+1].y;
				m[j+1].y=t;

				t=m[j].z;
				m[j].z=m[j+1].z;
				m[j+1].z=t;
			}
		}
	}

    for(i=0;i<n*(n-1)/2;i++)
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n",m[i].p,m[i].q,m[i].r,m[i].x,m[i].y,m[i].z,m[i].d);
}
int main(){
int N;
cin>>N;
int a[10][3];
int b[100][2];
int S=0;
float d[100];
for (int i=0;i<N;i++)cin>>a[i][0]>>a[i][1]>>a[i][2];
for (int i=0;i<N;i++){
for (int j=i;j<N;j++){
if (i==j)continue;
b[S][0]=i;b[S][1]=j;
d[S]=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]));
//cout<<d[S]<<endl;
S++;
}
}
int t;
float ft;
for (int i=0;i<S;i++){
for (int j=S-1;j>i;j--){
if (d[j]>d[j-1]){
ft=d[j];d[j]=d[j-1];d[j-1]=ft;
t=b[j][0];b[j][0]=b[j-1][0];b[j-1][0]=t;
t=b[j][1];b[j][1]=b[j-1][1];b[j-1][1]=t;
}
}
}
cout<<fixed;
for (int i=0;i<S;i++){
cout<<"("<<a[b[i][0]][0]<<","<<a[b[i][0]][1]<<","<<a[b[i][0]][2]<<")-("<<a[b[i][1]][0]<<","<<a[b[i][1]][1]<<","<<a[b[i][1]][2]<<")="<<setprecision(2)<<d[i]<<endl;
}
cin>>N;
return 0;
}
/*
 * Distance sorting.cpp
 *
 *  Created on: 2013-11-6
 *      Author: ???
 */
int main()
{   int a[10],b[10],c[10];
    float d[100],p,x[100][3],y[100][3];
    int i,j,n,k,m=0,s,t;
    cin>>n;
    for(i=0;i<n;i++)
    	cin>>a[i]>>b[i]>>c[i];
    for(i=0;i<n-1;i++)
    {
    	for(j=i+1;j<n;j++)
    	{
    	      x[m][0]=a[i];
    	      x[m][1]=b[i];
    	      x[m][2]=c[i];
    	      y[m][0]=a[j];
    	      y[m][1]=b[j];
    	      y[m][2]=c[j];
    	      d[m]=sqrt((x[m][0]-y[m][0])*(x[m][0]-y[m][0])+(x[m][1]-y[m][1])*(x[m][1]-y[m][1])+(x[m][2]-y[m][2])*(x[m][2]-y[m][2]));
    	      m++;
    	}
    }
    for(j=0;j<m-1;j++)
    {
    	for(i=0;i<m-1-j;i++)
    	{
    		if(d[i]<d[i+1])
    		{
    			p=d[i];
    			d[i]=d[i+1];
    			d[i+1]=p;
    			for(k=0;k<3;k++)
    			{   s=x[i][k];
    				x[i][k]=x[i+1][k];
    				x[i+1][k]=s;
    				t=y[i][k];
    				y[i][k]=y[i+1][k];
    				y[i+1][k]=t;
    			}
    		}
    	}
    }
    for(i=0;i<m;i++)
    	cout<< fixed<<setprecision(0)<<"("<<x[i][0]<<","<<x[i][1]<<","<<x[i][2]<<")-("<<y[i][0]<<","<<y[i][1]<<","<<y[i][2]<<")="<< fixed<<setprecision(2)<<d[i]<<endl;


	 return 0;

}
//********************************
//*?????(14-4) ????      **
//*?????? 1300012887 **
//*???2013.12.11 **
//********************************
int main()
{
	int n, i, j, k = 0;
	cin >> n;  //????
	struct dian   //?????dian
	{
		int x;
		int y;
		int z;
	} a[12];  //???????a
	for (i = 0; i < n; i++)
		cin >> a[i].x >> a[i].y >> a[i].z;  //???????
	struct cha  //?????cha
	{
		int x1;
		int y1;
		int z1;
		int x2;
		int y2;
		int z2;
		double c;
	} b[46], t;  //???????b,???t
	for (i = 0; i < n-1; i++)  //???????????
		for (j = i+1; j < n; j++)
		{
			b[k].x1 = a[i].x;
			b[k].y1 = a[i].y;
			b[k].z1 = a[i].z;
			b[k].x2 = a[j].x;
			b[k].y2 = a[j].y;
			b[k].z2 = a[j].z;  //???
			b[k].c = sqrt((b[k].x2 - b[k].x1) * (b[k].x2 - b[k].x1) + (b[k].y2 - b[k].y1) * (b[k].y2 - b[k].y1) + (b[k].z2 - b[k].z1) * (b[k].z2 - b[k].z1));  //??????
			k++;  //??
		}
	for (i = 0; i < k-1; i++)  //????????????
		for (j = 0; j < k-i-1; j++)
		{
			if (b[j].c < b[j+1].c)
			{
				t = b[j];
				b[j] = b[j+1];
				b[j+1] = t;
			}
		}
	for (i = 0; i < k; i++)  //??????
	{
		cout << "(" << b[i].x1 << "," << b[i].y1 << "," << b[i].z1 << ")" << "-" << "(" << b[i].x2 << "," << b[i].y2 << "," << b[i].z2 << ")" << "=" ;
		cout << fixed << setprecision(2) << b[i].c << endl;
	}
	return 0;
}
int main()
{
  struct pointlong
  {
	int a1;
	int b1;
	int c1;
	int a2;
	int b2;
	int c2;
	double sl;
  };
    struct pointlong point[10000];
	int x[11]={0};
	int y[11]={0};
	int z[11]={0};
	double a[11][11]={0};
	double c[1000]={0};
	int i,j,n,k,p,sum,w,f;
	float m;
	double temp;
	k=0;
	w=0;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d %d %d",&x[i],&y[i],&z[i]);
	}
	sum=n*(n-1)/2;
	for(i=0;i<n;i++)
	{
		for(j=i+1;j<n;j++)
		{
			m=(float)(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[i][j]=sqrt(m);
		}
	}
	for(i=0;i<n;i++)
	{
		for(j=i+1;j<n;j++)
		{
			c[k]=a[i][j];
			k=k+1;
		}
	}
	for(i=1;i<sum;i++)
	{
		for(j=0;j<sum;j++)
		{
			if(c[j]<c[j+1])
			{
				temp=c[j];
				c[j]=c[j+1];
				c[j+1]=temp;
			}
		}
	}
	for(i=0;i<=sum;i++)
	{
		for(j=0;j<n;j++)
		{
			for(p=j+1;p<n;p++)
			{
				if(a[j][p]==c[i])
				{
					point[w].a1=x[j];
					point[w].b1=y[j];
					point[w].c1=z[j];
					point[w].a2=x[p];
					point[w].b2=y[p];
					point[w].c2=z[p];
				    point[w].sl=c[i];
					w=w+1;

				}
			}
		}
	}
	for(i=0;i<w;i++)
	{
         f=0;
		for(j=0;j<i;j++)
		{
			if(point[i].a1==point[j].a1&&point[i].b1==point[j].b1&&point[i].c1==point[j].c1&&point[i].sl==point[j].sl&&point[i].a2==point[j].a2&&point[i].b2==point[j].b2&&point[i].c2==point[j].c2)
			{
				f=1;
				break;
			}
		}
		if(f==0)
		{

	
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",point[i].a1,point[i].b1,point[i].c1,point[i].a2,point[i].b2,point[i].c2,point[i].sl);
		}
	}
	return 0;
}
double h(int x1,int y1,int z1,int x2,int y2,int z2)
{
double s;
int x,y,z;
x=x1-x2;
y=y1-y2;
z=z1-z2;
s=sqrt(x*x+y*y+z*z);
return s;
}

int main()
{
	int n,a[10],b[10],c[10];
	int i,k,j;
	struct shizi{
		int x1;int x2;
		int y1;int y2;
		int z1;int z2;
		double l;
	} s[50],tmp;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d%d%d",&a[i],&b[i],&c[i]);
	
	}
	k=0;
	for(i=0;i<n;i++)
	{
		for(j=i+1;j<n;j++)
		{
			s[k].x1=a[i];
			s[k].x2=a[j];
			s[k].y1=b[i];
			s[k].y2=b[j];
			s[k].z1=c[i];
			s[k].z2=c[j];
			s[k].l=h(a[i],b[i],c[i],a[j],b[j],c[j]);
			k++;
		}
	}
	for(i=1;i<=k;i++)
	{
		for(j=0;j<k-1;j++)
		{
			if(s[j].l<s[j+1].l)
			{
				tmp=s[j];
				s[j]=s[j+1];
				s[j+1]=tmp;
			}
		}
	}
	for(i=0;i<k;i++)
	{
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",s[i].x1,s[i].y1,s[i].z1,s[i].x2,s[i].y2,s[i].z2,s[i].l);
	}
	return 0;
}