semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
// ?????? ???1000010500 
// ???? 
// 2010-12-20

struct point                   // ????? 
{
       int x,y,z;
}dot[10];
int main()
{
    int n,i,j,k,p,q;
    double distance[10][10],t,max,min = 200;
    cin >> n;
    for (i = 0;i < n;i++)                             // ???? 
        cin >> dot[i].x >> dot[i].y >> dot[i].z;
    for (i = 0;i < n - 1;i++)                         // ???i??j??? 
        for (j = i + 1;j < n;j++)
        {
            distance[i][j] = sqrt((dot[i].x - dot[j].x) * (dot[i].x - dot[j].x) 
                                + (dot[i].y - dot[j].y) * (dot[i].y - dot[j].y) 
                                + (dot[i].z - dot[j].z) * (dot[i].z - dot[j].z));
            // ?????????? 
            min = (distance[i][j] < min) ? distance[i][j] : min; 
        }
    for (k = 0;k < n * (n - 1) / 2;k++)               // ????????? 
    {
        max = min;
        for (i = n - 2;i >= 0;i--)
            for (j = n - 1;j >= i + 1;j--)
            {
                if (max <= distance[i][j])
                {
                                 max = distance[i][j];
                                 p = i;
                                 q = j;
                }       
            }
        cout << "(" << dot[p].x << "," << dot[p].y << "," << dot[p].z << ")-(" 
                    << dot[q].x << "," << dot[q].y << "," << dot[q].z << ")="
                    << fixed << setprecision(2)<< distance[p][q] << endl;
        distance[p][q] = 0;
    }
    return 0;
}
int main()
{
	float a[32]={0},c[12][12]={0};//???????????i?????j????????
	int i,j,m=0,n=0;
	cin>>n;
	for(i=1;i<=3*n;i++)
		cin>>a[i];
	for(i=1;i<n;i++)
	{
		for(j=i+1;j<=n;j++)
		{
			c[i][j]=sqrt((a[i*3-1]-a[j*3-1])*(a[i*3-1]-a[j*3-1])+(a[i*3-2]-a[j*3-2])*(a[i*3-2]-a[j*3-2])+(a[i*3]-a[j*3])*(a[i*3]-a[j*3]));//????
		}
	}
	int e,f,z=0,y,g;
	y=n*(n-1)/2;//????????
	for(g=y;g>=1;g--)//???????????
	{
		for(i=1;i<n;i++)
		{
			for(j=i+1;j<=n;j++)
			{
				z=0;
				for(e=1;e<n;e++)
				{
					for(f=e+1;f<=n;f++)
					{
						if(c[i][j]>=c[e][f])//????
							z=z+1;
					}
				}
				if(z==g)
				{
					cout<<"("<<a[i*3-2]<<","<<a[i*3-1]<<","<<a[i*3]<<")-("<<a[j*3-2]<<","<<a[j*3-1]<<","<<a[j*3]<<")=";
					printf("%0.2f", c[i][j]);
					cout<<endl;
				}
			}

		}
	}
		return 0;
}
int main()                                                  //?????
{
	int n;                                                  //????
	cin>>n;                                                 //????
	double a[20][4]={0};                                    //????a???n????
	double dis[50];                                         //?????????????????
	int u[50],v[50],l = 1;                                  //????u,v??????????
	for(int i = 1 ; i <= n ; i++)                           //??n??????
	{
		for(int j = 1 ; j <= 3 ; j++)                       
		{
			cin>>a[i][j];
		}
	}
	
	for(int i = 1 ; i < n ; i++)                            //??????????????????dis,?????u,v???????????
	{
		for(int j = i+1 ; j <= n ; j++)
		{
			dis[l]=sqrt((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]))*1.00;
			u[l]=i;
			v[l]=j;
			l++;
		}
	}

    int m=0;                                                //????????dis?????????????u,v?????
	int q=0;
	double p=0;
	for(int i = 1 ; i <= l-2 ; i++)     
	{
		for(int j = 1 ; j < l-1 ; j++)
		{
			if(dis[j]<dis[j+1])
			{
                 p=dis[j];
				 dis[j]=dis[j+1];
				 dis[j+1]=p;

				 m=u[j];
				 u[j]=u[j+1];
				 u[j+1]=m;

				 q=v[j];
				 v[j]=v[j+1];
				 v[j+1]=q;
			}
		}
	}

	for(int i = 1 ; i <= l-1 ; i++)                          //??????
	{
		cout<<"("<<a[u[i]][1]<<","<<a[u[i]][2]<<","<<a[u[i]][3]<<")-("<<a[v[i]][1]<<","<<a[v[i]][2]<<","<<a[v[i]][3]<<")"<<"=";
		printf("%.2f\n",dis[i]);
	}
	return 0;                                                //???????????????????

}
unsigned int com[45][2];
float dis[45];
void swap(int i,int j)
{
	unsigned int t_1[2];
	float t_2;
	t_2=dis[i];
	dis[i]=dis[j];
	dis[j]=t_2;
	t_1[0]=com[i][0];
	com[i][0]=com[j][0];
	com[j][0]=t_1[0];
	t_1[1]=com[i][1];
	com[i][1]=com[j][1];
	com[j][1]=t_1[1];
}
int main(void)
{

	int i,j,n,s=0,coord[10][3];
	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d %d %d ",&coord[i][0],&coord[i][1],&coord[i][2]);
	for(i=0;i<n;i++)
		for(j=i+1;j<n;j++)
		{
			com[s][0]=i;
			com[s][1]=j;
			dis[s]=sqrt(pow(coord[i][0]-coord[j][0],2)+pow(coord[i][1]-coord[j][1],2)+pow(coord[i][2]-coord[j][2],2));
			s++;
		}
	for(i=s;i>0;i--)
		for(j=0;j<i-1;j++)
			if(dis[j]<dis[j+1])
				swap(j,j+1);
	for(i=0;i<s;i++)
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n",coord[com[i][0]][0],coord[com[i][0]][1],coord[com[i][0]][2],coord[com[i][1]][0],coord[com[i][1]][1],coord[com[i][1]][2],dis[i]);
	fclose(stdin);
	return 0;
}
//**********************************************************
//*  ?????1.cpp                                       *
//*  ??????1200012906                                *
//*  ???2012?12?10?                                  *
//*  ?????????                                    *
//**********************************************************

struct
{
    int id;
	int x1;
	int y1;
	int z1;
	int x2;
	int y2;
	int z2;
	double distance;
}date[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++)
		{
			date[k].id = k;
			date[k].x1 = x[i];
			date[k].y1 = y[i];
			date[k].z1 = z[i];
			date[k].x2 = x[j];
			date[k].y2 = y[j];
			date[k].z2 = z[j];
			date[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 = k - 2; i >= 0; i--)
		for(j = k - 1; j >= i + 1; j--)
		{
			if (date[i].distance < date[j].distance || date[i].distance == date[j].distance && date[j].id < date[i].id)
			{   //???????????????
				t = date[i];
				date[i] = date[j];
				date[j] = t;
			}
		}
	for(i = 0; i < k; i++)
	{
		cout << "(" << date[i].x1 << "," << date[i].y1 << "," << date[i].z1 << ")-(";
		cout << date[i].x2 << "," << date[i].y2 << "," << date[i].z2 << ")=";
		cout << fixed << setprecision(2) << sqrt(date[i].distance) << endl;
	}
	return 0;
}
int main()
{
	int n,i,j,k;
	int a[11][3];
	float d[10][10]={0},h=0.0;
	float max=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++)
		{
			h=(a[i][0]-a[j][0])*(a[i][0]-a[j][0])+(a[i][1]-a[j][1])*(a[i][1]-a[j][1])+(a[i][2]-a[j][2])*(a[i][2]-a[j][2]);
			d[i][j]=sqrt(h);
		}
	for (k=0;k<n*(n-1)/2;k++)
	{
	    for (i=0;i<n;i++)
		    for (j=i+1;j<n;j++)
		        if (d[i][j]>max)
				    max=d[i][j];
		for (i=0;i<n;i++)
		    for (j=i+1;j<n;j++)
		        if (d[i][j]==max)
				{
					cout<<"("<<a[i][0]<<","<<a[i][1]<<","<<a[i][2]<<")-("
					<<a[j][0]<<","<<a[j][1]<<","<<a[j][2]<<")="
					<<fixed<<setprecision(2)<<d[i][j]<<endl;
					d[i][j]=-1;
				}
		max=0.0;
	}
	return 0;
}
int main(){
	int m,n,i,k,s=0,p,q;
	double c[45];
    double e;
	double d[10][3];
	scanf("%d",&n);
	for(m=0;m<n;m++){
		for(i=0;i<3;i++){
		scanf("%lf",&(d[m][i]));
		}
	}
for(m=0;m<n;m++){
	for(k=m+1;k<n;k++){
	c[s]=sqrt((d[m][0]-d[k][0])*(d[m][0]-d[k][0])+(d[m][1]-d[k][1])*(d[m][1]-d[k][1])+(d[m][2]-d[k][2])*(d[m][2]-d[k][2]));
	s=s+1;
	}}
for(p=1;p<=s;p++){
for(i=0;i<s-p;i++){

	if(c[i]>c[i+1]){
	e=c[i+1];
	c[i+1]=c[i];
	c[i]=e;
	}
}}

for(q=s-1;q>=0;q--){
	
for(m=0;m<n;m++){
	for(k=m+1;k<n;k++){
	if(sqrt((d[m][0]-d[k][0])*(d[m][0]-d[k][0])+(d[m][1]-d[k][1])*(d[m][1]-d[k][1])+(d[m][2]-d[k][2])*(d[m][2]-d[k][2]))==c[q]){
  printf("(%.0lf,%.0lf,%.0lf)-(%.0lf,%.0lf,%.0lf)=%.2lf\n", d[m][0], d[m][1], d[m][2], d[k][0],d[k][1], d[k][2],c[q]);
	}
	
	}
}
for(p=q;p>0;p=p-1){
	if(c[p]==c[p-1]){
		q=q-1;
	
	
	}
	else break;
}
}

return 0;
}
void main()
{
  char *p;
  int a[12][3], n,i,j,t=1;
  double b[50][3],temp;
  p="%d%d%d";
  scanf("%d",&n);
  for(i=1;i<=n;i++)
  {
     scanf(p,&a[i][0],&a[i][1],&a[i][2]);
  }
  for(i=1;i<=n-1;i++)
	  for(j=i+1;j<=n;j++)
	  {
	    b[t][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));
		b[t][1]=i;
		b[t][2]=j;
		t++;
	  }
  for(i=1;i<t-1;i++)
	  for(j=1;j<t-i;j++)
	  {
	    if(b[j][0]<b[j+1][0])
		{
		   temp=b[j+1][0];
		   b[j+1][0]=b[j][0];
		   b[j][0]=temp;
		   temp=b[j+1][1];
		   b[j+1][1]=b[j][1];
		   b[j][1]=temp;
		   temp=b[j+1][2];
		   b[j+1][2]=b[j][2];
		   b[j][2]=temp;
		
		}
	  }
  for(i=1;i<t;i++)
	  printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n",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],b[i][0]);
}
int main() {
	int n;
	cin >> n;
	int point[10][3] = {0}; // to store the position of the points
	float distance[45][3] = {0}; // to store the distances
	for(int i = 0; i < n; i++)
		for(int j = 0; j < 3; j++)
			cin >> point[i][j];
	int count = 0; // to calculate the number of the distances
	for(int i = 0; i < n - 1; i++)
		for(int j = i + 1; j < n; j++) {   // to calculate the distances and store the name of the points
			distance[count][0] = i;
			distance[count][1] = j;
			distance[count][2] = sqrt((float)(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]));
			count++;
		}
	float temp = 0;
	for(int i = 0; i < count - 1; i++) // bubble sort
		for(int j = i + 1; j < count ; j++) {
			if(distance[i][2] < distance[j][2]) {
				temp = distance[i][0];
			    distance[i][0] = distance[j][0];
				distance[j][0] = temp;
				temp = distance[i][1];
			    distance[i][1] = distance[j][1];
				distance[j][1] = temp;
				temp = distance[i][2];
			    distance[i][2] = distance[j][2];
				distance[j][2] = temp;
			}
			else if(distance[i][2] == distance[j][2]) {
				if(distance[i][0] > distance[j][0]) {
					temp = distance[i][0];
			        distance[i][0] = distance[j][0];
				    distance[j][0] = temp;
				    temp = distance[i][1];
			        distance[i][1] = distance[j][1];
				    distance[j][1] = temp;
				    temp = distance[i][2];
			        distance[i][2] = distance[j][2];
				    distance[j][2] = temp;
				}
				if(distance[i][1] > distance[j][1]) {
					temp = distance[i][0];
			        distance[i][0] = distance[j][0];
				    distance[j][0] = temp;
				    temp = distance[i][1];
			        distance[i][1] = distance[j][1];
				    distance[j][1] = temp;
				    temp = distance[i][2];
			        distance[i][2] = distance[j][2];
				    distance[j][2] = temp;
				}
			}
		}
	for(int i = 0; i < count; i++) {
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n", point[(int)distance[i][0]][0],point[(int)distance[i][0]][1],point[(int)distance[i][0]][2],point[(int)distance[i][1]][0],point[(int)distance[i][1]][1],point[(int)distance[i][1]][2],distance[i][2]);

	}
	
	return 0;
}
double juli(int a,int b,int c,int d,int e,int f);

int main(){
	int x[10],y[10],z[10];
	int x1[1000],y1[1000],z1[1000],x2[1000],y2[1000],z2[1000];
	int n,p=0;
	double ju[1000];
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%d",&x[i]);
		scanf("%d",&y[i]);
		scanf("%d",&z[i]);
	}
	for(int a=0;a<100;a++){
		for(int b=a+1;b<n;b++){
			ju[p]=juli(x[a],y[a],z[a],x[b],y[b],z[b]);
			x1[p]=x[a];
			y1[p]=y[a];
			z1[p]=z[a];
			x2[p]=x[b];
			y2[p]=y[b];
			z2[p]=z[b];
			p++;
		}
	}
	for(int k=1;k<=p-1;k++){
        double e;
		int o;
        for(int i=0;i<=p-1-k;i++){
            if(ju[i]<ju[i+1]){
               e=ju[i+1];
               ju[i+1]=ju[i];
               ju[i]=e;
			   o=x1[i+1];
               x1[i+1]=x1[i];
               x1[i]=o;
			   o=y1[i+1];
               y1[i+1]=y1[i];
               y1[i]=o;
			   o=z1[i+1];
               z1[i+1]=z1[i];
               z1[i]=o;
			   o=x2[i+1];
               x2[i+1]=x2[i];
               x2[i]=o;
			   o=y2[i+1];
               y2[i+1]=y2[i];
               y2[i]=o;
			   o=z2[i+1];
               z2[i+1]=z2[i];
               z2[i]=o;
			}
		}
	}
	for(int q=0;q<p;q++){
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",x1[q],y1[q],z1[q],x2[q],y2[q],z2[q],ju[q]);
	}
	return 0;
}

double juli(int a,int b,int c,int d,int e,int f){
	double result;
	double l,m,n;
	l=1.0*(d-a)*(d-a);
	m=1.0*(e-b)*(e-b);
	n=1.0*(f-c)*(f-c);
	result=sqrt(l+m+n);
	return result;
}
void main()
{
	int num,r,s,t,q2,a[200],b[200];
	double x[20],y[20],z[20],result[200],q1;
	scanf("%d",&num);
	for(r=0;r<num;r++) scanf("%lf%lf%lf",&x[r],&y[r],&z[r]);
	for(r=0,t=0;r<num-1;r++){
		for(s=r+1;s<num;s++){
			result[t]=sqrt((x[r]-x[s])*(x[r]-x[s])+(y[r]-y[s])*(y[r]-y[s])+(z[r]-z[s])*(z[r]-z[s]));
			a[t]=r;b[t]=s;
			t++;
		}
	}
	for(r=0;r<num*(num-1)/2-1;r++){
		for(s=num*(num-1)/2-1;s>r;s--){
			if(result[s-1]<result[s]){q1=result[s-1];result[s-1]=result[s];result[s]=q1;
				q2=a[s-1];a[s-1]=a[s];a[s]=q2;q2=b[s-1];b[s-1]=b[s];b[s]=q2;}
		}
	}
	for(r=0;r<num*(num-1)/2;r++)
	printf("(%.0f,%.0f,%.0f)-(%.0f,%.0f,%.0f)=%.2f\n",x[a[r]],y[a[r]],z[a[r]],x[b[r]],y[b[r]],z[b[r]],result[r]);
}
int main(){
	int x[10],y[10],z[10],n,i,j,k=0;
	struct{
		double d;
		int nu1,nu2;
	}p[50],zh;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d%d%d",&x[i],&y[i],&z[i]);
	}
	for(j=0;j<n-1;j++){
		for(i=j+1;i<n;i++){
			p[k].d=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]));
			p[k].nu1=j;
			p[k].nu2=i;
			k++;
		}
	}
	for(i=0;i<k-1;i++){
		for(j=0;j<k-1-i;j++){
			if(p[j].d>p[j+1].d){
				zh=p[j+1];
				p[j+1]=p[j];
				p[j]=zh;
			}
			else if(p[j].d==p[j+1].d){
				if(p[j].nu1<p[j+1].nu1){
					zh=p[j+1];
				p[j+1]=p[j];
				p[j]=zh;
				}
				else if((p[j].nu1==p[j+1].nu1)&&(p[j].nu2<p[j+1].nu2)){
					zh=p[j+1];
				p[j+1]=p[j];
				p[j]=zh;
				}
			}
		}
	}
	for(i=k-1;i>=0;i--){
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",x[p[i].nu1],y[p[i].nu1],z[p[i].nu1],x[p[i].nu2],y[p[i].nu2],z[p[i].nu2],p[i].d);
	}
	return 0;
}
int point[MAX][3];
double d;
struct {
int x1,x2,y1,y2,z1,z2;
double d;
}dis[DISTANCE],mid;
int n,m=0,i,j;
int main(){
   scanf("%d",&n);
   for(i=0;i<=n-1;i++){
      scanf("%d%d%d",&point[i][0],&point[i][1],&point[i][2]);
   }
   for(i=0;i<=n-2;i++){
	   for(j=i+1;j<=n-1;j++){
	      dis[m].x1=point[i][0];
		  dis[m].x2=point[j][0];
		  dis[m].y1=point[i][1];
		  dis[m].y2=point[j][1];
		  dis[m].z1=point[i][2];
		  dis[m].z2=point[j][2];
dis[m].d=sqrt((dis[m].x1-dis[m].x2)*(dis[m].x1-dis[m].x2)+(dis[m].y1-dis[m].y2)*(dis[m].y1-dis[m].y2)+(dis[m].z1-dis[m].z2)*(dis[m].z1-dis[m].z2));
		  m++;
	   }
   }
   for(i=0;i<=m-1;i++){
	   for(j=0;j<m-1;j++){
		   if(dis[j].d<dis[j+1].d){
			   mid=dis[j];
			   dis[j]=dis[j+1];
			   dis[j+1]=mid;
		   }
	   }
   }
   for(i=0;i<=m-1;i++){
printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",dis[i].x1,dis[i].y1,dis[i].z1,dis[i].x2,dis[i].y2,dis[i].z2,dis[i].d);
   }
   return 0;
}
int main()
{
	int n,i,k,m,p,t,zong;
	double ju;
	int a[100],b[100],c[100],xe[100],f[100],g[100],h[100],l[100],he[100];
	double juli[100];
	scanf("%d",&n);
		for(i=0;i<n;i++){
    scanf("%d%d%d",&a[i],&b[i],&c[i]);
		}
	k=0;
	 int x;	
	 for(m=0;m<n;m++){
		for(p=m+1;p<n;p++){

x=(a[m]-a[p])*(a[m]-a[p])+(b[m]-b[p])*(b[m]-b[p])+(c[m]-c[p])*(c[m]-c[p])	;		
 juli[k]=sqrt(x);
  xe[k]=a[m];
	  f[k]=b[m];
	  g[k]=c[m];
  h[k]=a[p];
	  l[k]=b[p];
	  he[k]=c[p];
  k++;
		}
	}
zong=n*(n-1)/2;
			for(i=0;i<zong;i++){
				for(k=0;k<zong-i-1;k++){
					if(juli[k]<juli[k+1]){
						ju=juli[k];	
						juli[k]=juli[k+1];
						juli[k+1]=ju;
						t=xe[k];	
						xe[k]=xe[k+1];
						xe[k+1]=t;
						t=f[k];	
						f[k]=f[k+1];
						f[k+1]=t;
						t=g[k];	
						g[k]=g[k+1];
						g[k+1]=t;
                    	t=he[k];	
						he[k]=he[k+1];
						he[k+1]=t;
	                	t=h[k];	
						h[k]=h[k+1];
						h[k+1]=t;
						t=l[k];	
						l[k]=l[k+1];
						l[k+1]=t;
					}
				}
			}
		for(i=0;i<zong;i++){
printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",xe[i],f[i],g[i],h[i],l[i],he[i],juli[i]);
		}
		return 0;
	}
struct position
{
	int x;
	int y;
	int z;
}pos[10];
int main()
{
	int n, finish[10][10] = {0}, cnt = 0;
	float d[10][10] = {0}, square = 0, max = 0;
	cin >> n;
	for (int i = 0; i < n; i++)
		cin >> pos[i].x >> pos[i].y >> pos[i].z;
	for (int i = 0; i < n - 1; i++)
	{
		for (int j = i + 1; j < n; j++)
		{
			square = (pos[i].x - pos[j].x) * (pos[i].x - pos[j].x) + (pos[i].y - pos[j].y) * (pos[i].y - pos[j].y) +
			 (pos[i].z - pos[j].z) * (pos[i].z - pos[j].z);
			d[i][j] = sqrt(square);
		}
	}
	for (int k = 0; k < n * (n - 1) / 2; k++, max = 0)
	{
		for (int i = 0; i < n; i++)
		{
			for (int j = 0; j < n; j++)
			{
				if (max < d[i][j] && finish[i][j] == 0)
					max = d[i][j];
			}
		}
		for (int p = 0; p < n; p++)
		{
			for (int q = 0; q < n; q++)
			{
				if (max == d[p][q])
				{
					finish[p][q] = 1;
					cnt++;
					cout << "(" << pos[p].x << ',' << pos[p].y << ',' << pos[p].z << ")-(" << pos[q].x << ',' << pos[q].y << ',' << pos[q].z << ")=" << fixed << setprecision(2) << d[p][q] << endl;
				}
			}
		}
		if (cnt == n * (n - 1) / 2)
			break;
	}
	return 0;
}
int main(){
	int i,a,b,c=1,p,q,n,M[46],N[46],e;
	double x[11],y[11],z[11],l[46],d;
	scanf("%d ",&n);
	for(i=1;i<=n;i++){
		scanf("%lf %lf %lf",&x[i],&y[i],&z[i]);
	}

	for(a=1;a<n;a++){
		for(b=a+1;b<=n;b++){
			l[c]=sqrt((x[a]-x[b])*(x[a]-x[b])+(y[a]-y[b])*(y[a]-y[b])+(z[a]-z[b])*(z[a]-z[b]));
			M[c]=a;
			N[c]=b;
			c++;
		}
	}
	for(p=1;p<(n*(n-1))/2;p++){
		for(q=p+1;q<=(n*(n-1));q++){
			if(l[p]<l[q]){
				for(i=q;i>p;i--){
					d=l[i];
					l[i]=l[i-1];
					l[i-1]=d;
					e=M[i];
					M[i]=M[i-1];
					M[i-1]=e;
					e=N[i];
					N[i]=N[i-1];
					N[i-1]=e;
				}
			}
		}
	}

	for(i=1;i<=n*(n-1)/2;i++){
		printf("(%.0lf,%.0lf,%.0lf)-(%.0lf,%.0lf,%.0lf)=%.2lf\n",x[M[i]],y[M[i]],z[M[i]],x[N[i]],y[N[i]],z[N[i]],l[i]);
	}

	return 0;
}
/*************************
??cpp4
????
???
2013/12/12
**************************/
int main()
{
	int n, i, j, k;
	cin >> n;
	struct point
	{
		int x;
		int y;
		int z;
	} a[12];
	for (i=1; i<=n; i++)
		cin >> a[i].x >> a[i].y >> a[i].z;
	struct distance
	{
		int x1;
		int y1;
		int z1;
		int x2; 
		int y2;
		int z2;
		double l;
	} b[60], temp;
	k=1;
	for (i=1; 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].l = sqrt (	pow ((double)(a[i].x)- (double)(a[j].x) , 2.0) + 	pow ((double)(a[i].y)- (double)(a[j].y) , 2.0) +	pow ((double)(a[i].z)- (double)(a[j].z) , 2.0));
			k++;
		}
	}
	for (i=1; i<= n*(n-1)/2; i++)
	{
		for (j=1; j<=n*(n-1)/2-1 ; j++)
		{
			if (b[j].l < b[j+1].l)
			{
				temp = b[j];
				b[j] = b[j+1];
				b[j+1] = temp;
			}
		}
	} 
	for (i=1; i<=n * (n-1) /2; i++)
	{
		cout << "(" << b[i].x1 << "," << b[i].y1 << "," << b[i].z1 << ")-";
		cout << "(" << b[i].x2 << "," << b[i].y2 << "," << b[i].z2 << ")=" ;
		cout << fixed;
		cout<<  setprecision(2) << b[i].l << endl;
	}
	return 0;
}
int main()
{
	int i, j, k = 0, x[10], y[10], z[10];
	int n;
	struct distance
	{
		int x1;
		int y1;
		int z1;
		int x2;
		int y2;
		int z2;
		double d;
	}dis[100], t;
	cin >> n;
	for (i = 0; i < n; i++)
	{
		cin >> x[i];
		cin >> y[i];
		cin >> z[i];
	}
	for (i = 0; i < n - 1; i++)
	{
		for (j = i + 1; j < n; j++)
		{
			dis[k].x1 = x[i];
			dis[k].y1 = y[i];
			dis[k].z1 = z[i];
			dis[k].x2 = x[j];
			dis[k].y2 = y[j];
			dis[k].z2 = z[j];
			dis[k].d = 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 = 0; j < k - 1 - i; j++)
		{
			if (dis[j].d < dis[j + 1].d)
			{
				t = dis[j];
				dis[j] = dis[j + 1];
				dis[j + 1] = t;
			}
		}
	}
	for (i = 0; i < k; i++)
	{
		cout << "(" << dis[i].x1 << ","
			 << dis[i].y1 << "," 
			 << dis[i].z1 << ")-(" 
			 << dis[i].x2 << "," 
			 << dis[i].y2 << "," 
			 << dis[i].z2 << ")=" 
			 << fixed << setprecision(2) << dis[i].d << endl;
	}
	return 0;
}
int main()
{
	int n,i,j,count,il,jl;
	int a[10][3];
	double m;
	double b[45];
	int c[45][2];
	scanf("%d",&n);
    count=0;


    for(i=0;i<n;i++)
	{
		scanf("%d %d %d",&a[i][0],&a[i][1],&a[i][2]);
	}                                                             //????


   
    

    for(i=0;i<n-1;i++)
	{
		for(j=i+1;j<n;j++)                                        //????????
		{
            m=sqrt((a[i][0]-a[j][0])*(a[i][0]-a[j][0])+(a[i][1]-a[j][1])*(a[i][1]-a[j][1])+(a[i][2]-a[j][2])*(a[i][2]-a[j][2]));

			b[count]=m;
			c[count][0]=i;
			c[count][1]=j;
			count=count+1;
		}
	}

	


	for(i=0;i<(n-1)*n/2;i++)
	{
		for(j=0;j<(n-1)*n/2-1;j++)
		{
			
			if(b[j]<b[j+1])
			{
				m=b[j+1];
				b[j+1]=b[j];
				b[j]=m;


				il=c[j+1][0];
				c[j+1][0]=c[j][0];
				c[j][0]=il;


				jl=c[j+1][1];
				c[j+1][1]=c[j][1];
				c[j][1]=jl;
			}
			if(b[j]==b[j+1])
			{

				m=b[j+1];
				b[j+1]=b[j];
				b[j]=m;


				il=c[j+1][0];
				c[j+1][0]=c[j][0];
				c[j][0]=il;


				jl=c[j+1][1];
				c[j+1][1]=c[j][1];
				c[j][1]=jl;
			}
		}
	}

    

	for(i=0;i<(n-1)*n/2;i++)
	{
		for(j=0;j<(n-1)*n/2-1;j++)
		{
			if(b[j]==b[j+1])
			{
				if(c[j][0]>c[j+1][0]||(c[j][0]==c[j+1][0]&&c[j][1]>c[j+1][1]))
				{
					m=b[j+1];
				    b[j+1]=b[j];
				    b[j]=m;


				    il=c[j+1][0];
				    c[j+1][0]=c[j][0];
				    c[j][0]=il;


				    jl=c[j+1][1];
				    c[j+1][1]=c[j][1];
			    	c[j][1]=jl;
				}
			}
		}
	}
	for(i=0;i<n*(n-1)/2;i++)
	{
		il=c[i][0];
		jl=c[i][1];
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",a[il][0],a[il][1],a[il][2],a[jl][0],a[jl][1],a[jl][2],b[i]);                                      
	}






	return 0;
}
double swap(double*x,double*y);
int main()
{
    int p,n,i,j;
	double q,x[11],y[11],z[11],px,py,pz,x1[46],y1[46],z1[46],x2[46],y2[46],z2[46];
	double l[46]={0};
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%lf%lf%lf",&x[i],&y[i],&z[i]);
	}
	p=0;
	for(i=0;i<n;i++)
	{
		for(j=i+1;j<n;j++)
		{
			x1[p]=x[i];y1[p]=y[i];z1[p]=z[i];x2[p]=x[j];y2[p]=y[j];z2[p]=z[j];
			px=x[i]-x[j];py=y[i]-y[j];pz=z[i]-z[j];q=pow(px,2)+pow(py,2)+pow(pz,2);
			l[p]=pow(q,0.5);p++;
		}
	}
	p--;
	for(i=p;i>=0;i--)
	{
		for(j=0;j<p;j++)
		{
			if(l[j]<l[j+1])
			{
				swap(&l[j],&l[j+1]);
				swap(&x1[j],&x1[j+1]);swap(&y1[j],&y1[j+1]);swap(&z1[j],&z1[j+1]);
				swap(&x2[j],&x2[j+1]);swap(&y2[j],&y2[j+1]);swap(&z2[j],&z2[j+1]);
			}
		}
	}
	for(i=0;i<=p;i++)
	{
		printf("(%g,%g,%g)-(%g,%g,%g)=%.2lf\n",x1[i],y1[i],z1[i],x2[i],y2[i],z2[i],l[i]);

	}
	return 0;
}
double swap(double*x,double*y)
{
	double t;
	t=*x;*x=*y;*y=t;
	return 0;
}
int main(){
	int n;
	struct point{
		int x,y,z,i;
	}points[10];
		struct jieguo{
		struct point pointqian;
		struct point pointhou;
		double juliss;
	}e,jieguos[45];
	scanf("%d",&n);
	int i=0;
	for(i=0;i<n;i++){
		scanf("%d%d%d",&points[i].x,&points[i].y,&points[i].z);
	}
	int m=0,k=0;
	i=0;
	for(m=0;m<n;m++){
		for(k=m+1;k<n;k++){
			jieguos[i].pointqian=points[m];
			jieguos[i].pointhou=points[k];
            jieguos[i].juliss=sqrt((jieguos[i].pointqian.x-jieguos[i].pointhou.x)*(jieguos[i].pointqian.x-jieguos[i].pointhou.x)+(jieguos[i].pointqian.y-jieguos[i].pointhou.y)*(jieguos[i].pointqian.y-jieguos[i].pointhou.y)+(jieguos[i].pointqian.z-jieguos[i].pointhou.z)*(jieguos[i].pointqian.z-jieguos[i].pointhou.z));
			i++;
		}
	}
	for(k=1;k<(n*(n-1)/2);k++){
		for(i=0;i<(n*(n-1)/2)-k;i++){
			if(jieguos[i].juliss<jieguos[i+1].juliss){
				e=jieguos[i+1];
				jieguos[i+1]=jieguos[i];
				jieguos[i]=e;
			}
		}
	}
	for(i=0;i<(n*(n-1)/2);i++){
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",jieguos[i].pointqian.x,jieguos[i].pointqian.y,jieguos[i].pointqian.z,jieguos[i].pointhou.x,jieguos[i].pointhou.y,jieguos[i].pointhou.z,jieguos[i].juliss);
	}
	return 0;
}