semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
    double n,x[100],y[100],z[100],c[100],l[100][100],e;
    int a[1000],b[1000],i,j,m,p,q;
    scanf("%lf",&n);
    m=0;
    for(i=0;i<n;i++)
    {
        scanf("%lf%lf%lf",&x[i],&y[i],&z[i]);
    }
    for(i=0;i<n;i++)
    {
        for(j=(i+1);j<n;j++)
        {  
            l[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]));
            c[m]=l[i][j];
            a[m]=i;
            b[m]=j;
            m=m+1;
        }
    }
    for(p=0;p<m;p++)
    {
        for(q=0;q<(m-1-p);q++)
        {
            if(c[q]>c[q+1])
            {
                e=c[q+1];
                c[q+1]=c[q];
                c[q]=e;
                e=a[q+1];
                a[q+1]=a[q];
                a[q]=e;
                e=b[q+1];
                b[q+1]=b[q];
                b[q]=e;
            }
        }
    }
    for(p=0;p<m;p++)
    {
        for(q=0;q<(m-1-p);q++)
        {
            if(c[q]==c[q+1])
            {
                if(a[q]<a[q+1]||b[q]<b[q+1])
                {
                    e=a[q+1];
                    a[q+1]=a[q];
                    a[q]=e;
                    e=b[q+1];
                    b[q+1]=b[q];
                    b[q]=e;
                }
            }
        }
    }
    for(i=m-1;i>=0;i--)
    {
        printf("(%.0lf,%.0lf,%.0lf)-(%.0lf,%.0lf,%.0lf)=%.2lf\n",x[a[i]],y[a[i]],z[a[i]],x[b[i]],y[b[i]],z[b[i]],c[i]);
    }
    return 0;
}
double distance(int xa,int ya,int za,int xb,int yb,int zb);
double distance(int xa,int ya,int za,int xb,int yb,int zb){
    int sum;
    double dis;
    sum=(xb-xa)*(xb-xa)+(yb-ya)*(yb-ya)+(zb-za)*(zb-za);
    dis=sqrt(sum);
    return dis;
}

int main(){
    int n,i,t,j,b=0,w=0,te;
    double td;
    scanf("%d",&n);
    struct point{
        int x,y,z;
    }point[10];
    for(i=0;i<n;i++)
    scanf("%d %d %d",&point[i].x,&point[i].y,&point[i].z);
    struct{
        int p,q;
        double dist;
    }temp[45];
    for(i=0;i<45;i++)
    temp[i].dist=-1;
    for(i=0;i<n;i++)
        for(j=0;j<i;j++){
            temp[w].p=i;
            temp[w].q=j;
            temp[w].dist=distance(point[i].x,point[i].y,point[i].z,point[j].x,point[j].y,point[j].z);
            w=w+1;
        }
        
for(i=0;i<45;i++)
    for(w=0;w<44;w++)
        if(temp[w].dist<temp[w+1].dist)
        {
            te=temp[w+1].p;
            temp[w+1].p=temp[w].p;
            temp[w].p=te;
            te=temp[w+1].q;
            temp[w+1].q=temp[w].q;
            temp[w].q=te;    
            td=temp[w+1].dist;
            temp[w+1].dist=temp[w].dist;
            temp[w].dist=td;
        }
        

for(w=0;w<45;w++)

if(temp[w].dist!=-1){
    printf("(%d,%d,%d)-",point[temp[w].q].x,point[temp[w].q].y,point[temp[w].q].z);
    printf("(%d,%d,%d)=",point[temp[w].p].x,point[temp[w].p].y,point[temp[w].p].z);
    printf("%.2lf\n",temp[w].dist);
}
    return 0;
}
int main()
{
	int x[20] = {0}, y[20] = {0}, z[20] = {0}, n, flag1[200], flag2[200], i, j, k = 1, p;
	double distance[200], t;
	cin >> n;
	for (i = 1; i <= n; i++)
	{
		cin >> x[i] >> y[i] >> z[i];
	}
	for (i = 1; i <= n; i++)
	{
		for (j = i + 1; j <= n; j++, k++)
		{
			distance[k] = sqrt(pow(x[i] - x[j], 2.0) + pow(y[i] - y[j], 2.0) + pow(z[i] - z[j], 2.0));
			flag1[k] = i;
			flag2[k] = j;
		}
	}
	for (k = 1; k <= n * (n - 1) / 2; k++)
	{
		for (i = 1; i <= n * (n - 1) / 2 + 1 - k; i++)
		{
			if (distance[i] < distance[i + 1])
			{
				t = distance[i];
				distance[i] = distance[i + 1];
				distance[i + 1] = t;
				p = flag1[i];
				flag1[i] = flag1[i + 1];
				flag1[i + 1] = p;
				p = flag2[i];
				flag2[i] = flag2[i + 1];
				flag2[i + 1] = p;
			}
		}
	}
	for (i = 1; i <= n * (n - 1) / 2; i++)
	{
		cout << "(" << x[flag1[i]] << "," << y[flag1[i]] << "," << z[flag1[i]] << ")-(" << x[flag2[i]] << "," << y[flag2[i]] << "," << z[flag2[i]] << ")=" << fixed << setprecision(2) << distance[i] << endl;
	}
	return 0;
}
int main(){
	int n,i,j,c,d,s[10][3],k,f;
	double a[10][10],e;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		for(j=0;j<3;j++){
			scanf("%d",&s[i][j]);
	}}
	for(i=0;i<n-1;i++){
		for(j=i+1;j<n;j++){
			a[i][j]=sqrt(pow(s[i][0]-s[j][0],2)+pow(s[i][2]-s[j][2],2)+pow(s[i][1]-s[j][1],2));
	}}
	e=0;f=(n*n-n)/2;
	for(k=1;k<=f;k++){
		for(i=0;i<n;i++){
			for(j=i+1;j<n;j++){
				if(e<a[i][j]){
					e=a[i][j];
					c=i;
					d=j;
		}}}
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",s[c][0],s[c][1],s[c][2],s[d][0],s[d][1],s[d][2],e);
		e=0;
		a[c][d]=0;
		c=0;
		d=0;
	
	}
	return 0;
}
int main(){
	int a[10][3],dian[50][2],n,i,j,k=0,m;
	double d[50],temp;
	cin >> n;
	for(i=0;i<n;i++){
		cin >> 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((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]));
			dian[k][0]=i;
			dian[k][1]=j;
			k++;}
	}
	for(i=0;i<k-1;i++){
		for(j=0;j<k-i-1;j++){
			if(d[j]<d[j+1]){
				temp=d[j];
				d[j]=d[j+1];
				d[j+1]=temp;
				m=dian[j][0],dian[j][0]=dian[j+1][0],dian[j+1][0]=m;
				m=dian[j][1],dian[j][1]=dian[j+1][1],dian[j+1][1]=m;
			}
		}
	}
	for(i=0;i<k;i++){
		cout <<"("<<a[dian[i][0]][0]<<","<<a[dian[i][0]][1]<<","<<a[dian[i][0]][2]<<")"<<"-"<<"("<<a[dian[i][1]][0]<<","<<a[dian[i][1]][1]<<","<<a[dian[i][1]][2]<<")"<<"="<<fixed<<setprecision(2)<<d[i]<<endl;
	}
	return 0;
}
struct loc
{
	int x;
	int y;
	int z;
};
int main()
{
	struct loc a[10];
	double len[10][10],max;
	int n,i,j,k,no1,no2;
	memset(len,0,sizeof(len));
	scanf("%d",&n);
	for (i=0;i<n;i++)
		scanf("%d%d%d",&a[i].x,&a[i].y,&a[i].z);
	for (i=0;i<n-1;i++)
		for (j=i+1;j<n;j++)
			len[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));
	for (k=0;k<(n-1)*n/2;k++)
	{
		max=0;
		for (i=0;i<n-1;i++)
			for (j=i+1;j<n;j++)
				if (len[i][j]>max)
				{
					max=len[i][j];
					no1=i;
					no2=j;
				}
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n",a[no1].x,a[no1].y,a[no1].z,a[no2].x,a[no2].y,a[no2].z,len[no1][no2]);
		len[no1][no2]=0;
	}
	return 0;
}
int main()
{
	int n;
	struct dian
	{
		float a;
		int x;
		int y;
	}a[45];
	struct dian t;
	int d[10][3];
	int i,j,k=0;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d%d%d",&d[i][0],&d[i][1],&d[i][2]);
	}
	for(i=1;i<n;i++)
	{
		for(j=0;j<i;j++)
		{
			a[k].a=sqrt((d[i][0]-d[j][0])*(d[i][0]-d[j][0])+(d[i][1]-d[j][1])*(d[i][1]-d[j][1])+(d[i][2]-d[j][2])*(d[i][2]-d[j][2]));
			a[k].x=j;
			a[k].y=i;
			k++;
		}
	}
	for(i=0;i<k-1;i++)
	{
		for(j=0;j<k-1-i;j++)
		{
			if(a[j].a<a[j+1].a)
			{
				t=a[j];
				a[j]=a[j+1];
				a[j+1]=t;
			}
		}
	}
	for(i=0;i<k;i++)
	{
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n",d[a[i].x][0],d[a[i].x][1],d[a[i].x][2],d[a[i].y][0],d[a[i].y][1],d[a[i].y][2],a[i].a);
	}
	
	return 0;
}
int main()
{
  int sz1[10][3],n,i=0,m;
  double d[100],e;
  scanf("%d", &n);
  m=n*(n-1)/2;
  for (int row=0; row<n; row++){
      for (int col=0; col<3; col++){
           scanf("%d", &sz1[row][col]);
      }
  }
    for (int row1=0; row1<n; row1++){
         for (int row2=row1+1; row2<n; row2++){
             d[i]=sqrt((pow(sz1[row1][0]-sz1[row2][0],2)+pow(sz1[row1][1]-sz1[row2][1],2)+pow(sz1[row1][2]-sz1[row2][2],2))*1.0);
             i=i+1;
       }
   }
   for(int k=1;k<=m;k++){
        for (i=0;i<m-k;i++){
    	  if (d[i]>d[i+1]){
			e=d[i+1];
			d[i+1]=d[i];
			d[i]=e;
		  }
    	} 
    }
    d[m]=0;
    for (i=m-1;i>=0;i--){  
       for (int row1=0; row1<n; row1++){
         for (int row2=row1+1; row2<n; row2++){
             if(d[i]!=d[i+1]){
             if(sqrt((pow(sz1[row1][0]-sz1[row2][0],2)+pow(sz1[row1][1]-sz1[row2][1],2)+pow(sz1[row1][2]-sz1[row2][2],2))*1.0)==d[i]){
               printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",sz1[row1][0],sz1[row1][1],sz1[row1][2],sz1[row2][0],sz1[row2][1],sz1[row2][2],d[i]);
             }}
          }
       }
   }
   return 0;
}
int main() {
 
    int n;
    scanf("%d",&n);
    
    struct coordinate{int x;int y;int z;int io;}pt[n];
    int i;
    for(i=0;i<n;i=i+1)
    {
        scanf("%d %d %d",&(pt[i].x),&(pt[i].y),&(pt[i].z));
        pt[i].io=i;
    }
    
    int j;
    int m;
    m=n*(n-1)/2;//?????
    
    struct distance{struct coordinate pt1;struct coordinate pt2;double l;}dist[m];
    
   int t=0;
    
    for(i=0;i<n;i=i+1)
    {
        for(j=i+1;j<n;j=j+1)
        {
            dist[t].pt1=pt[i];
            dist[t].pt2=pt[j];
            dist[t].l=sqrt(pow(1.0*(dist[t].pt1.x-dist[t].pt2.x),2.0)+pow(1.0*(dist[t].pt1.y-dist[t].pt2.y),2.0)+pow(1.0*(dist[t].pt1.z-dist[t].pt2.z),2.0));
            t=t+1;
        }
    }
    
    struct distance temp;
    
    int s=0;
    
    while(s==0)
    {
        s=1;
        for(i=0;i<m-1;i++)
        {
            if(dist[i].l<dist[i+1].l)
            {
                temp=dist[i];
                dist[i]=dist[i+1];
                dist[i+1]=temp;
                s=0;
                 
            }
        }
    }
    
    
    for(i=0;i<m;i++)
    {
        printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",dist[i].pt1.x,dist[i].pt1.y,dist[i].pt1.z,dist[i].pt2.x,dist[i].pt2.y,dist[i].pt2.z,dist[i].l);
    }
    
  

    
    return(0);
    
    
}
int dist(int x1,int y1,int z1,int x2,int y2,int z2)
{
	return (x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)+(z1-z2)*(z1-z2);
}
int main()
{
	int x[10],y[10],z[10],d[100],i,j,n,m,k,a1[100],b1[100],c1[100],a2[100],b2[100],c2[100];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d%d%d",&x[i],&y[i],&z[i]);
	}
	k=0;
	for(i=0;i<n-1;i++)
	{
		for(j=i+1;j<n;j++)
		{
			d[k]=dist(x[i],y[i],z[i],x[j],y[j],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<k-1;i++)
	for(j=0;j<k-i-1;j++)
	{
		if(d[j]<d[j+1])
		{
			m=d[j];
			d[j]=d[j+1];
			d[j+1]=m;
			m=a1[j];
			a1[j]=a1[j+1];
			a1[j+1]=m;
			m=b1[j];
			b1[j]=b1[j+1];
			b1[j+1]=m;
			m=c1[j];
			c1[j]=c1[j+1];
			c1[j+1]=m;
			m=a2[j];
			a2[j]=a2[j+1];
			a2[j+1]=m;
			m=b2[j];
			b2[j]=b2[j+1];
			b2[j+1]=m;
			m=c2[j];
			c2[j]=c2[j+1];
			c2[j+1]=m;
		}
	} 
	for(i=0;i<k;i++)
	printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",a1[i],b1[i],c1[i],a2[i],b2[i],c2[i],sqrt(d[i]));
	return 0;
}
void main()
{   
	struct point
	{
		int x;
		int y;
		int z;
	}P[10];
	
   struct triple  
   {
	   struct point A;
	   struct point B;
	   double d;
   }pair[50],tmp;

   int n,i,j,k,c[31];

   scanf("%d",&n);
   for(i=1;i<=3*n;i++)
	   scanf("%d",&c[i]);

   for(i=0;i<n;i++)
   {
	   (P[i]).x=c[3*i+1];
       (P[i]).y=c[3*i+2];
	   (P[i]).z=c[3*i+3];
   }
   
  for(i=0;i<n;i++)
	   for(j=i+1;j<n;j++)
	   {   
		   k=i*n+j-i*(i+3)/2;
	       (pair[k]).A=P[i];
		   (pair[k]).B=P[j];
		   int X=P[i].x-P[j].x;
		   int Y=P[i].y-P[j].y;
		   int Z=P[i].z-P[j].z;
		   (pair[k]).d=sqrt(X*X+Y*Y+Z*Z);
	   }
   


  for(i=n*(n-1)/2;i>1;i--)
	  for(k=1;k<i;k++)
	  {
	     if ((pair[k]).d<(pair[k+1]).d)
		 {
	       tmp=pair[k+1];
	       pair[k+1]=pair[k];
	       pair[k]=tmp;
		 }
	  }
  
for(k=1;k<=n*(n-1)/2;k++)
printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",(pair[k]).A.x,(pair[k]).A.y,(pair[k]).A.z,(pair[k]).B.x,(pair[k]).B.y,(pair[k]).B.z,(pair[k]).d);

    
}
int main(){
    int n,nn;
    int a[101],b[101],c[101],x[46][3],y[46][3],xx[46],yy[46],px,py,pz;
    double jl[46],m;
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        scanf("%d %d %d",&a[i],&b[i],&c[i]);
    }
    int d=0;
    for(int w=0;w<n;w++){
        for(int j=w+1;j<n;j++){
            jl[d]=sqrt(1.0*(a[w]-a[j])*(a[w]-a[j])+(b[w]-b[j])*(b[w]-b[j])+(c[w]-c[j])*(c[w]-c[j]));
			x[d][0]=a[w];
			x[d][1]=b[w];
			x[d][2]=c[w];
			y[d][0]=a[j];
			y[d][1]=b[j];
			y[d][2]=c[j];
            xx[d]=w;
            yy[d]=j;
            d++;
        }
    }
    
    for(int k=1;k<=n*(n-1)/2;k++){
        for(int j=0;j<n*(n-1)/2-k;j++){
            if(jl[j]>jl[j+1]||(xx[j]<xx[j+1]&&jl[j]==jl[j+1])||(yy[j]<yy[j+1]&&xx[j]==xx[j+1]&&jl[j]==jl[j+1])){
                m=jl[j+1];
                
                jl[j+1]=jl[j];
                jl[j]=m;
                
                nn=xx[j+1];
                
                xx[j+1]=xx[j];
                xx[j]=nn;
                nn=yy[j+1];
                
                yy[j+1]=yy[j];
                yy[j]=nn;
                
                px=x[j+1][0];
                py=x[j+1][1];
                pz=x[j+1][2];
                x[j+1][0]=x[j][0];
                x[j+1][1]=x[j][1];
                x[j+1][2]=x[j][2];
                x[j][0]=px;
                x[j][1]=py;
                x[j][2]=pz;
                
                px=y[j+1][0];
                py=y[j+1][1];
                pz=y[j+1][2];
                y[j+1][0]=y[j][0];
                y[j+1][1]=y[j][1];
                y[j+1][2]=y[j][2];
                y[j][0]=px;
                y[j][1]=py;
                y[j][2]=pz;
                
                
            }
        }
    }
    
    for(int j=n*(n-1)/2-1;j>=0;j--){
        printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n",x[j][0],x[j][1],x[j][2],y[j][0],y[j][1],y[j][2],jl[j]);
    }
    
}
struct point
{
int x;
int y;
int z;
};  //?????????
struct point dian[101];
double distance(struct point dian[],int i,int j){
	int x=dian[i].x-dian[j].x;
	int y=dian[i].y-dian[j].y;
	int z=dian[i].z-dian[j].z;
	double dis=(double)(x*x+y*y+z*z);
	return sqrt(dis);
}
 int main()
 {
	 int n,i,j;
	 int t=0,k=0;
	 double a[105];
	 cin>>n;
	 for(i=0;i<n;++i)
		 cin>>dian[i].x>>dian[i].y>>dian[i].z;
	 for(i=0;i<n;++i)
		 for(j=i+1;j<n;++j)
			 { int t=0;
                   while(t<k+1 &&(a[t]-distance(dian,i,j)>0.00001 ||distance(dian,i,j)-a[t]>0.00001)) t++;
                   if(t==k+1){ a[k]=distance(dian,i,j);  
                k++; }
              }
	 int count=k;
	 for(i=0;i<count;i++)
		 for(j=0;j<count-i;j++)
			 if(a[j]<a[j+1]){
				 double temp=a[j];
				 a[j]=a[j+1];
				 a[j+1]=temp;
			 }
	              k=0;
				  while(k<count){
				    for(i=0;i<n;++i){
		            for(j=i+1;j<n;++j){ 
						
						if(abs(a[k]-distance(dian,i,j))<0.0000001)
					printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n\n",dian[i].x,dian[i].y,dian[i].z,dian[j].x,dian[j].y,dian[j].z,distance(dian,i,j));
					}
					}
					k++;
				  }
					 //while(1); 
	 return 0;
 }
int main(){
	int n,i,j,k=0,z;
	int a[10][3];
    scanf("%d",&n);
    
    for(i=0;i<n;i++){
                      
                     if(i==0){
                     scanf("%d %d %d",&a[0][0],&a[0][1],&a[0][2]);
                    }
                     else{
                     scanf(" %d %d %d",&a[i][0],&a[i][1],&a[i][2]);}
                     }
    struct {
           int b[3],c[3];
           float d;
           }x[46];
    
    for(i=0;i<n;i++){
                     for(j=i+1;j<n;j++){
                                        
                                        x[k].b[0]=a[i][0];
                                      
                                        x[k].b[1]=a[i][1];
                                        x[k].b[2]=a[i][2];
                                        x[k].c[0]=a[j][0];
                                        x[k].c[1]=a[j][1];
                                        x[k].c[2]=a[j][2];
                                        x[k].d=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++;
                                        }
                                        }
    
    
    for(i=0;i<k;i++){
                     for(j=k-1;j>i;j--){
                                        if(x[j].d>x[j-1].d){
                                                            x[45]=x[j];
                                                            x[j]=x[j-1];
                                                            x[j-1]=x[45];
                                                            }
                                                            }
                                                            }
    for(i=0;i<k;i++){
                     printf("\n(%d,%d,%d)-(%d,%d,%d)=%.2f",x[i].b[0],x[i].b[1],x[i].b[2],x[i].c[0],x[i].c[1],x[i].c[2],x[i].d);
                     }
                                                            
                                                            
    
    
    
return 0;}
int main(){
    int a1[100],a2[100],a3[100],n,z[100],i,j,k=0,a[100],b[100];
    double o,m,x[100],y[100];
    scanf("%d\n",&n);
    for(i=0;i<n;i++){
        scanf("%d%d%d",&a1[i],&a2[i],&a3[i]);
    }
    for(i=0;i<n;i++){
        for(j=i+1;j<n;j++){
            x[k]=(a1[i]-a1[j])*(a1[i]-a1[j])+(a2[i]-a2[j])*(a2[i]-a2[j])+(a3[i]-a3[j])*(a3[i]-a3[j]);
            y[k]=sqrt(x[k]);
            a[k]=i;
            b[k]=j;
            k=k+1;
        }
    }
    for(i=1;i<=k;i++){
        for(j=0;j<k-i;j++){
            if(y[j]<y[j+1]){
                m=y[j];
                y[j]=y[j+1];
                y[j+1]=m;
                
                m=a[j];
                a[j]=a[j+1];
                a[j+1]=m;
                
                m=b[j];
                b[j]=b[j+1];
                b[j+1]=m;
            }
        }
    }
    for(i=0;i<k;i++){
        printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",a1[a[i]],a2[a[i]],a3[a[i]],a1[b[i]],a2[b[i]],a3[b[i]],y[i]);
    }
}
/*
 * 80.cpp
 * ??????
 *  Created on: 2011-12-14
 * ???????????n??????10??,??n?????????,???????????????????????????
 */

int main()
{
	int n,i,k,j,p,t=0;
	double q;
	cin>>n;
	struct zb
	{
		int x;
		int y;
		int z;
	}aa[n];

	for(i=0;i<n;i++)
	{
		cin>>aa[i].x>>aa[i].y>>aa[i].z;
	}

	double s[n][n];
    for(i=0;i<n;i++)
    {
    	for(j=0;j<n;j++)
    	{
    		s[i][j]=0.0;
    	}
    }
	for(i=0;i<n-1;i++)
	{
		for(j=i+1;j<n;j++)
		{
			s[i][j]=(sqrt)((aa[i].x-aa[j].x)*(aa[i].x-aa[j].x)+(aa[i].y-aa[j].y)*(aa[i].y-aa[j].y)+(aa[i].z-aa[j].z)*(aa[i].z-aa[j].z));
		}
	}

	k=(n-1)*(n-1);
	double ss[k];
	for(i=0;i<k;i++)
	{
		ss[i]=0.0;
	}
    for(i=0;i<n-1;i++)
    {
    	for(j=1;j<n;j++)
    	{
    		ss[t]=s[i][j];
    		t=t+1;
    	}
    }

    for(i=0;i<k;i++)
    {
    	for(j=0;j<k-i-1;j++)
    	{
    		if(ss[j]<ss[j+1])
    		{
    			q=ss[j+1];
    			ss[j+1]=ss[j];
    			ss[j]=q;
    		}
    	}
    }

    p=n*(n-1)/2;
    int a=0;
	for(t=0;t<p;t++)
	{
		for(i=0;i<n-1;i++)
		{
			for(j=1;j<n;j++)
			{
				if(ss[t]==s[i][j])
				{
					cout<<"("<<aa[i].x<<","<<aa[i].y<<","<<aa[i].z<<")"<<"-"<<"("<<aa[j].x<<","<<aa[j].y<<","<<aa[j].z<<")"<<"=";
					cout<<fixed<<setprecision(2)<<s[i][j]<<endl;
					s[i][j]=-1.0;
					a=1;

				}
			}
		}
	}
	return 0;
}
//* * * * * * * * * * * * * * * * * * * * * * * * 
//*????????                             *
//*????????.cpp                         *
//*?????  1000012839                       *
//*???2010.12.18                             *
//* * * * * * * * * * * * * * * * * * * * * * * * 

struct Dot
{
	int dot1[3];	//	????????
	int dot2[3];	//	????????
	double distance;	//	???????
} s[45], temp;
int main()
{
	int dot[10][3];	//	??????
	int n;	//	?????
	int i, j, k;	//	?????

	cin >> n;
	for (i = 0; i < n; i++)
		cin >> dot[i][0] >> dot[i][1] >> dot[i][2];	
	k = 0;
	for (i = 0; i < n - 1; i++)
	{
		for (j = i + 1; j < n; j++)
		{
			s[k].dot1[0] = dot[i][0];
			s[k].dot1[1] = dot[i][1];
			s[k].dot1[2] = dot[i][2];
			s[k].dot2[0] = dot[j][0];
			s[k].dot2[1] = dot[j][1];
			s[k].dot2[2] = dot[j][2];
			s[k].distance = sqrt(pow(dot[i][0] - dot[j][0],2) + pow(dot[i][1] - dot[j][1],2) + pow(dot[i][2] - dot[j][2],2));
			k++;	//	??????????????
		}
	}
	for (i = 0; i < k - 1; i++)	//	??k?n*(n-1)/2?
	{
		for (j = 0; j < k - i; j++)
		{
			if (s[j].distance < s[j + 1].distance)
			{
				temp = s[j];
				s[j] = s[j + 1];
				s[j + 1] = temp;	//	??????
			}
		}
	}
	for (i = 0; i < k; i++)
		cout << '(' << s[i].dot1[0] << ',' << s[i].dot1[1] << ',' << s[i].dot1[2] << ")-(" << s[i].dot2[0] 
		<< ',' << s[i].dot2[1] << ',' << s[i].dot2[2] << ")=" << fixed << setprecision(2) << s[i].distance << endl;
	return 0;
}
int n,x,y,z;
int p;
struct point
{
    int x,y,z;
}
points[10];

struct print
{
    double l;
    struct point p1,p2;
}
prints[45];
void scan();
void count();
void sort();
void print();
int main(){
    scan();
    count();
    sort();
    print();
    return 0;
}
void scan(){
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        scanf("%d%d%d",&x,&y,&z);
        points[i].x=x;
        points[i].y=y;
        points[i].z=z;
    }
}
void count(){
    int x1,y1,z1,x2,y2,z2;
    p=0;
    for(int i=0;i<n-1;i++){
        for(int j=i+1;j<n;j++){
            x1=points[i].x;
            y1=points[i].y;
            z1=points[i].z;
            x2=points[j].x;
            y2=points[j].y;
            z2=points[j].z;
            prints[p].l=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)+(z1-z2)*(z1-z2));
            prints[p].p1=points[i];
            prints[p].p2=points[j];
            p++;
        }
    }
}
void sort(){
    struct print temp;
    for(int k=1;k<=p;k++){
        for(int i=0;i<p-k;i++){
            if(prints[i].l<prints[i+1].l){
                temp=prints[i+1];
                prints[i+1]=prints[i];
                prints[i]=temp;
            }
        }
    }
}
void print(){
    int x1,y1,z1,x2,y2,z2;
    double l;
    for(int i=0;i<p;i++){
        x1=prints[i].p1.x;
        y1=prints[i].p1.y;
        z1=prints[i].p1.z;
        x2=prints[i].p2.x;
        y2=prints[i].p2.y;
        z2=prints[i].p2.z;
        l=prints[i].l;
        printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",x1,y1,z1,x2,y2,z2,l);
    }
}
/*
 * structure_4.cpp
 *
 *  Created on: 2010-12-29
 *      Author: ???
 *        ??? ????
 */



int main(){
	int n,i,j,num;
	cin>>n;
	struct point{                     //??????
		int x;
		int y;
		int z;
	} p[100];
	for(i=0;i<n;i++)                  //????????
		cin>>p[i].x>>p[i].y>>p[i].z;
	struct distance{                  //??????????
		double dis;
		int i;
		int j;
	} d[5000],temp;
	for(i=0,num=0;i<n-1;i++)          //?????
		for(j=i+1;j<n;j++,num++){
			d[num].dis=sqrt(pow(p[i].x-p[j].x,2.0)+pow(p[i].y-p[j].y,2.0)+pow(p[i].z-p[j].z,2.0));
			d[num].i=i;
			d[num].j=j;
		}
	for(i=0;i<num-1;i++)              //?????
		for(j=0;j<num-i-1;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<num;i++)                //????
		cout<<'('<<p[d[i].i].x<<','<<p[d[i].i].y<<','<<p[d[i].i].z<<")-("<<p[d[i].j].x<<','<<p[d[i].j].y<<','<<p[d[i].j].z<<")="<<fixed<<setprecision(2)<<d[i].dis<<endl;
	return 0;
}
/*
 * distance.cpp
 *
 *  Created on: 2013-11-1
 *      Author: ???1300012996
 */
int main(){
    int n;cin>>n;int a[n][3];//???????????
    for(int i=0;i<n;i++)
    for(int j=0;j<3;j++){
    	cin>>a[i][j];
    }
    int m=n*(n-1)/2;
    double d[m],t;//??????????
    int p=0,num[m][2],tt,ttt;
    for(int ii=0;ii<n;ii++)
    	for(int jj=ii+1;jj<n;jj++){
    	d[p]=sqrt((a[ii][0]-a[jj][0])*(a[ii][0]-a[jj][0])+
    			(a[ii][1]-a[jj][1])*(a[ii][1]-a[jj][1])+
    			(a[ii][2]-a[jj][2])*(a[ii][2]-a[jj][2]));
    	num[p][0]=ii;num[p][1]=jj;//??????????????????
    	p++;
    	}
    for(int iii=1;iii<m;iii++)
    	for(int jjj=0;jjj<m-iii;jjj++){
    		if(d[jjj]<d[jjj+1]){//??????????????????????????????
    			t=d[jjj];d[jjj]=d[jjj+1];d[jjj+1]=t;
    			tt=num[jjj][0];num[jjj][0]=num[jjj+1][0];num[jjj+1][0]=tt;
    			ttt=num[jjj][1];num[jjj][1]=num[jjj+1][1];num[jjj+1][1]=ttt;
    		}
    	}
    int iij,jji;
    for(int ij=0;ij<m;ij++){//?????
    	iij=num[ij][0];jji=num[ij][1];
    	cout<<"("<<a[iij][0]<<","
        		<<a[iij][1]<<","
        		<<a[iij][2]<<")-("
        		<<a[jji][0]<<","
        		<<a[jji][1]<<","
        		<<a[jji][2]<<")="
        		<<fixed<<setprecision(2)<<d[ij]<<endl;
    }
	return 0;
}
int main()
{
   int n,i,j,t,g,f,m,k;
   int a[10],b[10],c[10],z[50][6];
   double s[50],e;
   scanf("%d",&n);
   for(i=0;i<n;i++)
   {
      scanf("%d%d%d",&(a[i]),&(b[i]),&(c[i]));
   }
   t=0;
   for(i=0;i<n;i++)
   {
      for(j=i+1;j<n;j++)
	  {
	      s[t]=sqrt((a[i]-a[j])*(a[i]-a[j])+(b[i]-b[j])*(b[i]-b[j])+(c[j]-c[i])*(c[j]-c[i]));
          z[t][0]=a[i];z[t][1]=b[i];z[t][2]=c[i];z[t][3]=a[j];z[t][4]=b[j];z[t][5]=c[j];
		  t++;
	  }
   }
   e=0;k=0;
   for(i=1;i<=t;i++)
   {
      for(j=0;j<t-i;j++)
	  {
	      if(s[j]<s[j+1])
		  {
		      e=s[j+1];
			  s[j+1]=s[j];
              s[j]=e;
			  for(m=0;m<6;m++)
			  {
			      k=z[j+1][m];
				  z[j+1][m]=z[j][m];
				  z[j][m]=k;
			  }
		  }
	  }
   }
   for(g=0;g<t;g++)
   {
       	printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",z[g][0],z[g][1],z[g][2],z[g][3],z[g][4],z[g][5],s[g]);
		
   }
   return 0;
}