semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
/*
 * ????????.cpp
 * Created on: 2011-1-1
 * Author: ???
 */
struct {
	int abs;
	int ver;
	int ord;

} coor[10];  //??????

double fdis(int a, int b, int c, int d, int e, int f) {  //??????
	int m;
	double n;
	m = (a - d) * (a - d) + (b - e) * (b - e) + (c - f) * (c - f);
	n = sqrt((double) m);
	return n;
}

int main() {
	int n, i, j, k = 0, q, flag1[45], flag2[45], s, t;
	double dis[45], tempt;
	cin >> n;
	for (i = 0; i < n; i++) {
		cin >> coor[i].abs >> coor[i].ver >> coor[i].ord;
	}  //????
	for (i = 0; i < n - 1; i++) {
		for (j = i + 1; j < n; j++) {
			dis[k] = fdis(coor[i].abs, coor[i].ver, coor[i].ord, coor[j].abs,
					coor[j].ver, coor[j].ord);
			flag1[k] = i;
			flag2[k] = j;
			k++;
		}
	}
	for (k = 0; k < n * (n - 1) / 2; k++) {
		for (q = 0; q < n * (n - 1) / 2 - k - 1; q++) {
			if (dis[q] - dis[q + 1] < -1e-6) {
				s = flag1[q];
				flag1[q] = flag1[q + 1];
				flag1[q + 1] = s;
				t = flag2[q];
				flag2[q] = flag2[q + 1];
				flag2[q + 1] = t;
				tempt = dis[q];
				dis[q] = dis[q + 1];
				dis[q + 1] = tempt;  //??
			}
		}
	}
	for (k = 0; k < n * (n - 1) / 2; k++) {
		cout << "(" << coor[flag1[k]].abs << "," << coor[flag1[k]].ver << ","
				<< coor[flag1[k]].ord << ")-(" << coor[flag2[k]].abs << ","
				<< coor[flag2[k]].ver << "," << coor[flag2[k]].ord << ")"
				<< "=" << fixed << setprecision(2) << dis[k] << endl;
	}  //??
	return 0;
}
int main()
{
	int n,a[11][4],b[60][7],t[7];
	double c[60],t0;
	int i,j,l = 0;
	cin >> n;
	for(i = 1;i <= n;i++)
	{
		for(j = 1;j <= 3;j++)
			cin >> a[i][j];
	}
	for(i = 1;i <= n - 1;i++)
	{
		for(j = i + 1;j <= n;j++)
		{
			l++;
			b[l][1] = a[i][1];
			b[l][2] = a[i][2];
			b[l][3] = a[i][3];
			b[l][4] = a[j][1];
			b[l][5] = a[j][2];
			b[l][6] = a[j][3];
			c[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]));
		}
	}
	for(j = 1;j <= n * (n - 1) / 2 - 1;j++)
	{
		for(l = n * (n - 1) / 2 - 1;l >= j;l--)
		{
			if(c[l] < c[l + 1])
			{
				for(i = 1;i <= 6;i++)
				{
					t[i] = b[l][i];
					b[l][i] = b[l + 1][i];
					b[l + 1][i] = t[i];
				}
				t0 = c[l];
				c[l] = c[l + 1];
				c[l + 1] = t0;
			}
		}
	}
	for(l = 1;l <= n * (n - 1) / 2;l++)
	{
		cout << "(" << b[l][1] << "," 
			        << b[l][2] << "," 
					<< b[l][3] << ")" 
	  << "-" << "(" << b[l][4] << ","
                    << b[l][5] << "," 
					<< b[l][6] << ")" 
					<< "=" << fixed << setprecision(2) << c[l] << endl;
	}
	return 0;
}
int main()
{
	int n=0;
	cin>>n;
	double an[100][3];
	int i=0,j=0;
	for(i=0;i<n;i++)
		for(j=0;j<3;j++)
			cin>>an[i][j];
	struct 
	{
		int i;
		int j;
		double dis;
	}stu[1000],t;
	int k=0,m=0,p=0;
	for(m=0;m<n;m++)
	{
		for(p=m+1;p<n;p++)
		{
			stu[k].i=m;
			stu[k].j=p;
			double mm=(an[m][0]-an[p][0])*(an[m][0]-an[p][0])+(an[m][1]-an[p][1])*(an[m][1]-an[p][1])+(an[m][2]-an[p][2])*(an[m][2]-an[p][2]);
			stu[k].dis=sqrt(mm);
			k++;
		}
	}
	
	for(int q=0;q<k;q++)
		for(int qq=q+1;qq<k;qq++)
		{
			if((stu[q].dis<stu[qq].dis)||(stu[q].dis==stu[qq].dis)&&((stu[q].i>stu[qq].i)||(stu[q].i==stu[qq].i)&&(stu[q].j>stu[qq].j)))
			{
				t=stu[qq];
				stu[qq]=stu[q];
				stu[q]=t;
			}		
		}
	for(int r=0;r<k;r++)
		cout<<fixed << setprecision(0)<<"("<<an[stu[r].i][0]<<","<<an[stu[r].i][1]<<","<<an[stu[r].i][2]<<")-("<<an[stu[r].j][0]<<","<<an[stu[r].j][1]<<","<<an[stu[r].j][2]<<")="<<fixed << setprecision(2)<<stu[r].dis<<endl;
	return 0;
}
int main(){
	int x[10],y[10],z[10],weizhi[200],t,n,i,j,k,a,b;
	double juli[200],m,pingfanghe[200];
	scanf("%d",&n);
	k=0;

	for(i=0;i<n;i++) 
		scanf("%d%d%d",&x[i],&y[i],&z[i]);

	for(i=0;i<n;i++){
		for(j=i+1;j<n;j++){
			pingfanghe[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]);
            juli[k]=sqrt(pingfanghe[k]);
            weizhi[k]=i*10+j;
			k++;
		}
	}
	k--;
    for(i=k;i>0;i--){
		for(j=0;j<i;j++){
            if(juli[j]<juli[j+1]){
				m=juli[j];
				juli[j]=juli[j+1];
				juli[j+1]=m;
				t=weizhi[j];
				weizhi[j]=weizhi[j+1];
                weizhi[j+1]=t;
			}
		}
	}
	for(i=0;i<=k;i++){
        a=weizhi[i]/10;
		b=weizhi[i]%10;
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",x[a],y[a],z[a],x[b],y[b],z[b],juli[i]);
	}
    return 0;
}
int main()
{
    int i, j, k, l = 0, num;
    double temp = 0;
    int pos[100][3];
    double distance[9900] = {0};
    int latter[9900], former[9900];
    cin >> num;
    for (i = 0; i < num; i++)
    {
        for(j = 0; j < 3; j++)
        {
              cin >> pos[i][j];
        }
    }
    for (i = 0; i < num; i++)
    {
        for (j = i + 1; j < num; j++)
        {
            for (k = 0; k < 3; k++)
            {
                former[l] = i;
                latter[l] = j;
                distance[l] += (pos[i][k] - pos[j][k]) * (pos[i][k] - pos[j][k]);
            }
            distance[l] = sqrt (distance[l]);
            l++;
        }
    }
    l = (num - 1) * num / 2;
    for (i = 0; i < l - 1; i++)
    {
        for (j = 0; j < l - i - 1; j++)
        {
            if (distance[j] < distance[j + 1])
            {
                temp = distance[j];
                distance[j] = distance[j + 1];
                distance[j + 1] = temp;
                temp = latter[j];
                latter[j] = latter[j + 1];
                latter[j + 1] = temp;
                temp = former[j];
                former[j] = former[j + 1];
                former[j + 1] = temp;
            }
        }
    }
    for (i = 0; i < l; i++)
    {
        cout << "(" << pos[former[i]][0] << "," << pos[former[i]][1] 
        << "," << pos[former[i]][2] <<")-(" << pos[latter[i]][0] 
        << "," << pos[latter[i]][1] << "," << pos[latter[i]][2] 
        <<")=" << fixed << setprecision(2) << distance[i] << endl;
    }
    return 0;
}
//********************
//**???????	**
//**?????		**
//**???2013.12.15**
//**????4.cpp	**
//********************
int main()
{
	int n, i, j, cnt= 0, p[10][3];
	double sum;
	struct distance // ??????????????
	{
		int x1;
		int y1;
		int z1;
		int x2;
		int y2;
		int z2;
		double dist;
	}group[45], temp;
	cin >> n;
	for (i = 0; i < n; i++)
		cin >> p[i][0] >> p[i][1] >> p[i][2]; // ??????
	for (i = 0; i < n - 1; i++)
		for (j = 1; j < n - i; j++)
		{
			group[cnt].x1 = p[i][0];
			group[cnt].y1 = p[i][1];
			group[cnt].z1 = p[i][2];
			group[cnt].x2 = p[i + j][0];
			group[cnt].y2 = p[i + j][1];
			group[cnt].z2 = p[i + j][2];
			sum = (p[i][0] - p[i + j][0]) * (p[i][0] - p[i + j][0]) + 
				(p[i][1] - p[i + j][1]) * (p[i][1] - p[i + j][1]) + 
				(p[i][2] - p[i + j][2]) * (p[i][2] - p[i + j][2]);
			group[cnt].dist = sqrt(sum); // ????????????????????
			cnt++;
		}
	for (i = 0; i < n * (n - 1) / 2 - 1; i++)
		for (j = 0; j < n * (n - 1) / 2 - 1 - i; j++)
			if (group[j].dist < group[j + 1].dist) // ???????????????
			{
				temp = group[j];
				group[j] = group[j + 1];
				group[j + 1] = temp;
			}
	for (i = 0; i < n * (n - 1) / 2; i++)
	{
		cout << '(' << group[i].x1 << ',' << group[i].y1 << ',' << group[i].z1 << ')' << '-' 
		<< '(' << group[i].x2 << ',' << group[i].y2 << ',' << group[i].z2 << ')' << '=';
		printf("%.2f", group[i].dist); // ??????????????
		cout << endl;
	}
	return 0;
}
void main()
{
	struct distance
	{
		float a[2], b[2], c[2];
		float d;
	}dis[55];
	int n, i, j, k=0, r[55], t;
	float x[11], y[11], z[11];
	scanf("%d", &n);
	for(i=0; i<n; i++)
		scanf("%f%f%f", &x[i], &y[i], &z[i]);
	for(i=0; i<n-1; i++)
		for(j=i+1; j<n; j++)
		{
			dis[k].d=(x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j])+(z[i]-z[j])*(z[i]-z[j]);
			dis[k].a[0]=x[i]; dis[k].a[1]=x[j];
			dis[k].b[0]=y[i]; dis[k].b[1]=y[j];
			dis[k].c[0]=z[i]; dis[k].c[1]=z[j];
			r[k]=k;
			k++;
		}
	for(i=0; i<k-1; i++)
		for(j=0; j<k-1-i; j++)
			if(dis[r[j]].d<dis[r[j+1]].d)
			{
				t=r[j];
				r[j]=r[j+1];
				r[j+1]=t;
			}
	for(i=0; i<k; i++)
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n", (int)dis[r[i]].a[0], (int)dis[r[i]].b[0], (int)dis[r[i]].c[0], (int)dis[r[i]].a[1], (int)dis[r[i]].b[1], (int)dis[r[i]].c[1], sqrt(dis[r[i]].d));
}
struct point{             //?????point?????
	int x;
	int y;
	int z;
}pt[50];
struct data{              //?????data????????
	int num;
	struct point a;       //?1
	struct point b;       //?2
	double distance;      //??
}dt[10000],temp;
int main(){
	int n,i,j;            //????n????i?j
	cin>>n;
	for(i=0;i<n;i++)      //???????
	{
		cin>>pt[i].x;
		cin>>pt[i].y;
		cin>>pt[i].z;
	}
	int t=0;              //??dt??
	for(i=0;i<n;i++)
		for(j=i+1;j<n;j++)
		{
			dt[t].num=t;
			dt[t].a=pt[i];
			dt[t].b=pt[j];
			dt[t].distance=sqrt((pt[i].x-pt[j].x)*(pt[i].x-pt[j].x)+(pt[i].y-pt[j].y)*(pt[i].y-pt[j].y)+(pt[i].z-pt[j].z)*(pt[i].z-pt[j].z)); //????
			t++;
		}
	int k;               //??dt??
	k=t;
	for(i=0;i<k;i++)     //??
		for(j=i+1;j<k;j++)
		{
			if(dt[i].distance<dt[j].distance||(dt[i].distance==dt[j].distance&&dt[i].num>dt[j].num))
			{
				temp=dt[i];
				dt[i]=dt[j];
				dt[j]=temp;
			}
		}
	for(i=0;i<k;i++)     //??
	{
		cout<<"("<<dt[i].a.x<<","<<dt[i].a.y<<","<<dt[i].a.z<<")-("<<dt[i].b.x<<","<<dt[i].b.y<<","<<dt[i].b.z<<")=";
		printf("%.2lf\n",dt[i].distance);
	}
	return 0;
}
int main()
{
	int a[10][3] = {0} ;                   //a[10][3]??????????
	double b[45] = {0};	                   // b[45]????????????
	int biaoji[45][2] = {0} ;              //biaoji[45][2]???????????????
	int n = 0 , i = 0 , j = 0 , k = 0 ;    //n??????i,j,k?????
	cin >> n ;                             //??????
	for ( i = 0 ; i < n ; i++ )            //????????????
		for ( j = 0 ; j < 3 ; j++ )
			cin >> a[i][j] ;
	for (i = 0 ; i < n ; i++ )             //?????????????????
	{
		for(j = i+1 ; j <n; j++ )
		{
			b[k]= sqrt( (double) ( 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] ) ) ;   //????
			biaoji[k][0] = i ;             //?????????
			biaoji[k][1] = j ;			   //??????????????i,j???????????????????????
			k++ ;
		}
	}
	for ( i = 0 ; i < n * ( n - 1 ) / 2  ; i++ )     //??????????????????????????????
	{												 //???????????????????????????????????????????????????
		for( j = 0 ; j < n * ( n - 1 ) / 2 - i - 1 ; j++ )
		{
			if ( b[j+1] - b[j] > 1e-4 )              //????double?????????????????b[j]<b[j+1]????????????????????????
			{
				double temp ;                        //?????
				temp = b[j] ;
				b[j] = b[j+1] ;
				b[j+1] = temp ;
				int tempx ;
				tempx = biaoji[j][0] ;               //??????????
				biaoji[j][0] = biaoji[j+1][0] ;
				biaoji[j+1][0] = tempx ;
				tempx = biaoji[j][1] ;               //??????????
				biaoji[j][1] = biaoji[j+1][1] ;
				biaoji[j+1][1] = tempx ;
			}
		}
	}
	for( i = 0 ; i < n * ( n - 1 ) / 2 ; i++)        //??
		cout << "(" << a[biaoji[i][0]][0] << "," << a[biaoji[i][0]][1] << "," << a[biaoji[i][0]][2] << ")-(" << a[biaoji[i][1]][0] << "," << a[biaoji[i][1]][1] << "," << a[biaoji[i][1]][2] << ")=" << fixed << setprecision(2) << b[i] << endl ;
	return 0;
}
struct num1
{
    int a;
    int b;
    int c;
} num1[100];
struct num
{
    int x1;
    int x2;
    int x3;
    int x11;
    int x12;
    int x13;
    int l1;
    int l2;
    float sum;
}num[5010],k;
int main()
{  int t = 0,n,i,j,sum;
   scanf("%d",&n);
   for( i = 1; i <= n ;i ++)
   scanf("%d %d %d",&num1[i].a,&num1[i].b,&num1[i].c);
   for( i = 1; i <= n;i ++)
  {   
      for( j = i+1; j <= n ;j++  )
   {
      num[t].x1 = num1[i].a;
      num[t].x2 = num1[i].b;
      num[t].x3 = num1[i].c;
      num[t].x11 = num1[j].a;
      num[t].x12 = num1[j].b;
      num[t].x13 = num1[j].c;
      num[t].sum = (num[t].x1-num[t].x11)*(num[t].x1-num[t].x11)+(num[t].x2-num[t].x12)*(num[t].x2-num[t].x12)+(num[t].x3-num[t].x13)*(num[t].x3-num[t].x13);
      num[t].l1 = i;
      num[t].l2 = j;
      t ++ ;
   }
   } 
    for( i = 0;i <t ;i++ )
     {for ( j = i ;j <t;j++ )
         {  if(num[i].sum<num[j].sum)
           { k = num[i];
             num[i] = num[j];
             num[j] = k;  
           }
         }
     }
     for( i = 0;i <t ;i++ )
     {for ( j = i ;j <t;j++ )
         {  if((num[i].sum==num[j].sum)&&((num[i].l1>num[j].l1)||((num[i].l1==num[j].l1)&&(num[i].l2>num[j].l2))))
           { k = num[i];
             num[i] = num[j];
             num[j] = k;  
           }
         }
     }
      for( i = 0 ;i < t ;i++ )
     { printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n",num[i].x1,num[i].x2,num[i].x3,num[i].x11,num[i].x12,num[i].x13,sqrt(num[i].sum));}

}
/*
 * ds.cpp
 *
 *  Created on: 2011-12-9
 *      Author: admin
 */
struct place{
	int x;
	int y;
	int z;
};
struct distance{
	int i1;
	int i2;
	double dis;
};
int main(){
	int i,j,k,n;
	struct place a[11];
	struct distance d[100],temp;
	cin>>n;
	for (i=1;i<=n;i++){
		cin>>a[i].x>>a[i].y>>a[i].z;
	}
	k=1;
	for (i=1;i<=n-1;i++){
		for (j=i+1;j<=n;j++){
			d[k].i1=i;
			d[k].i2=j;
			d[k].dis=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));
			k++;
		}
	}
	for (i=k-1;i>=1;i--){
		for (j=1;j<=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=1;i<=k-1;i++){
		cout<<'('<<a[d[i].i1].x<<','<<a[d[i].i1].y<<','<<a[d[i].i1].z<<')'<<'-'<<
				'('<<a[d[i].i2].x<<','<<a[d[i].i2].y<<','<<a[d[i].i2].z<<')'<<'='<<
				fixed<<setprecision(2)<<d[i].dis;
		if (i!=k-1)cout<<endl;
	}
return 0;
}
void main()
{
	int n,a[10][3],b[45][2],i,j,k=0,t;
	float c[45],s;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&a[i][0]);
		scanf("%d",&a[i][1]);
		scanf("%d",&a[i][2]);
	}
	for(i=0;i<n;i++)
		for(j=i+1;j<n;j++)
		{
			b[k][0]=i;
			b[k][1]=j;
			c[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]));
			k++;
		}
	for(j=0;j<k-1;j++)
		for(i=0;i<k-1-j;i++)
		{
			if(c[i]<c[i+1])
			{
				s=c[i];
				c[i]=c[i+1];
				c[i+1]=s;
				t=b[i][0];
				b[i][0]=b[i+1][0];
				b[i+1][0]=t;
                t=b[i][1];
				b[i][1]=b[i+1][1];
				b[i+1][1]=t;
			}
		}
	for(i=0;i<k;i++) printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n",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],c[i]);
}
int main(){
int n;
int p[10][3],b[100],e[100];
int i,j,l;
int x;
double y;
double d[100];
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d %d %d ",&p[i][0],&p[i][1],&p[i][2]);
}
l=0;
while(l<n*(n-1)/2){
for(i=0;i<n-1;i++){
for(j=i+1;j<n;j++){
d[l]=sqrt(1.0*((p[i][0]-p[j][0])*(p[i][0]-p[j][0])+(p[i][1]-p[j][1])*(p[i][1]-p[j][1])+(p[i][2]-p[j][2])*(p[i][2]-p[j][2])));
    b[l]=i;
e[l]=j;
l++;
}
}

}
for(i=0;i<n*(n-1)/2-1;i++){
for(l=0;l<n*(n-1)/2-i;l++){
if(d[l]<d[l+1]){
y=d[l];
d[l]=d[l+1];
d[l+1]=y;
x=b[l];
b[l]=b[l+1];
b[l+1]=x;
x=e[l];
e[l]=e[l+1];
e[l+1]=x;
}
}
}
for(l=0;l<n*(n-1)/2;l++){
i=b[l];
j=e[l];
printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",p[(i)][0],(p[(i)][1]),(p[(i)][2]),(p[(j)][0]),(p[(j)][1]),(p[(j)][2]),d[l]);
}


return 0;
}
/*
 * 4.cpp
 *
 *  Created on: 2011-1-1
 *      Author: Administrator
 */

double f(int x1,int y1,int z1,int x2,int y2,int z2){
	double d2=(x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)+(z1-z2)*(z1-z2);
	return sqrt(d2);
}//?????
int main(){
	int x[10],y[10],z[10];//??????
	double d[10][10];//????
	int n;
	cin>>n;
	for(int i=0;i<n;i++)
		cin>>x[i]>>y[i]>>z[i];
	for(int i=0;i<n;i++)
		for(int j=0;j<i;j++){
			d[i][j]=f(x[i],y[i],z[i],x[j],y[j],z[j]);
		}//??????

	for(int k=0;k<n*(n-1)/2;k++ ){
		int a=0,b=0;
		double D=0;
		for(int i=0;i<n;i++)
			for(int j=0;j<i;j++){
				if(d[i][j]>D){
					D=d[i][j];
					a=i;
					b=j;
				}
			}//????????????
		cout<<"("<<x[b]<<","<<y[b]<<","<<z[b]<<")-("<<x[a]<<","<<y[a]<<","<<z[a]<<")=";
		cout<<fixed<<setprecision(2)<<D<<endl;//??
		d[a][b]=-1;//?????????????
	}
	return 0;
}
struct point{
	int x;
	int y;
	int z;};

struct dis{
	float distance;
	struct point d1;
	struct point d2;};

int main()
{
	void bubble(struct dis b[100],int len);
	float fun(struct point pt1,struct point pt2);
	int n,m,num,i,up,w;
	struct dis a[100]={0,0,0};
	struct point pt[10]={0,0,0};

	scanf("%d",&num);

	for(i=0;i<num;i++)
	{
		scanf("%d%d%d",&pt[i].x,&pt[i].y,&pt[i].z);
	}
	//printf("%d%d%d",pt[1].x,pt[2].x,pt[3].x);
	w=num*(num-1)/2;
	for(i=0;i<w;)
	{
	    for(n=0;n<num-1;n++)
		{
		     for(m=n+1;m<num;m++)
			 {
			     a[i].distance=fun(pt[n],pt[m]);
				 a[i].d1.x=pt[n].x;
				 //printf("%d",a[i].d1.x);
				 a[i].d1.y=pt[n].y;
				 a[i].d1.z=pt[n].z;
				 a[i].d2.x=pt[m].x;
				 a[i].d2.y=pt[m].y;
				 a[i].d2.z=pt[m].z;
				 i++;
			 }
		}
		
	}
	up=i;
	//printf("%d",up);
	//printf("%d%d",a[1].d1.x,a[1].d1.y);


    bubble(a,up);

	for(i=0;i<up;i++)
	{
		printf("(%d,%d,%d)-(%d,%d,%d)=%3.2f\n",a[i].d1.x,a[i].d1.y,a[i].d1.z,a[i].d2.x,a[i].d2.y,a[i].d2.z,a[i].distance);
	}

	return 0;
}

float fun(struct point p1,struct point p2)
{
	float result,mid;
	mid=(p1.x-p2.x)*(p1.x-p2.x)+(p1.y-p2.y)*(p1.y-p2.y)+(p1.z-p2.z)*(p1.z-p2.z);
	result=sqrt(mid);
	return(result);
}

void bubble(struct dis b[100],int len)
{
	int i,pass;
	struct dis temp;//temp????????????
	
	for(pass=1;pass<len;pass++)
	{
		for(i=0;i<len-pass;i++)
		{
			if(b[i].distance<b[i+1].distance)
			{temp=b[i];b[i]=b[i+1];b[i+1]=temp;}
		}
	}
}
int main()
{
    
    int x[10],y[10],z[10];
    int i,j=1,n,p,q,k=0,m;
	double d[10][10],max;
	
    scanf("%d\n",&n);
	
    for(i=0;i<n;i++)
		scanf("%d%d%d",&x[i],&y[i],&z[i]);
	
    i=0;
    
    if(n==2)
    {
        p=i;q=j;
        max=sqrt(1.0*(x[i]-x[j])*(x[i]-x[j])+1.0*(y[i]-y[j])*(y[i]-y[j])+1.0*(z[i]-z[j])*(z[i]-z[j]));
        printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",x[p],y[p],z[p],x[q],y[q],z[q],max);
        return 0;
        
    }
    
    for(i=0;i<n;i++)
	{
	
        for(j=i+1;j<n;j++)
		{
        
			d[i][j]=sqrt(1.0*(x[i]-x[j])*(x[i]-x[j])+1.0*(y[i]-y[j])*(y[i]-y[j])+1.0*(z[i]-z[j])*(z[i]-z[j]));
		  	
		}
	   
	}
	
    max=d[0][1];
	m=n*(n-1)/2;
	
    while(k<m)
    {
	
    for(i=0;i<n;i++)
	{
		
        for(j=i+1;j<n;j++)
		{
		
            if(max<d[i][j])
			{
            
				max=d[i][j];
				p=i;
				q=j;
			 		
			}
        
		}
	   
	}
	
    printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",x[p],y[p],z[p],x[q],y[q],z[q],max);
	
    d[p][q]=0.0;
	k++;
	max=0;
	   
	}
	
    return 0;
}
int main()
{
	int n, i, j, k, c[10][3], temp = 0,count = 0;
	cin >> n;
	struct 
	{
		int a[3];
		int b[3];
		int flag1;
		int flag2;
		double distance;
	}dian[46] = {0};
	for (i = 0; i < n; i++)
		for (j = 0; j < 3; j++)
			cin >> c[i][j];
	for (i = 0; i < n; i++)
		for (j = i + 1; j < n; j++)
		{
			temp = 0;
			for (k = 0; k < 3; k++)
			{
				dian[count].a[k] = c[i][k];
				dian[count].b[k] = c[j][k];
				dian[count].flag1 = i;
				dian[count].flag2 = j;
				temp = temp + (c[i][k] - c[j][k]) * (c[i][k] - c[j][k]);
			}
			dian[count].distance = sqrt(temp);
			count++;
		}
	for (i = count - 1; i >= 0; i--)
		for (j = count - 1; j >= 0; j--)
			if ((dian[i].distance > dian[j].distance && i > j) || ((dian[i].distance == dian[j].distance) && ((dian[i].flag1 < dian[j].flag1 && i > j) || (dian[i].flag1 == dian[j].flag1 && dian[i].flag2 < dian[j].flag2 && i > j))))
			{
				dian[45] = dian[i];
				dian[i] = dian[j];
				dian[j] = dian[45];
			}
	for (i = 0; i < count; i++)
		cout << "(" << dian[i].a[0] << "," << dian[i].a[1] << "," << dian[i].a[2] << ")" << "-" << "(" << dian[i].b[0] << "," << dian[i].b[1] << "," << dian[i].b[2] << ")" << "=" << fixed << setprecision(2) << dian[i].distance << endl;
	return 0;
}
int main(){
    int n,c,a,b,i,o,p;
    double e;
    scanf("%d",&n);
    double jl[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]);
    }
    for(a=0;a<n;a++){
        b=a+1;
        while(b<n){
            c=(x[a]-x[b])*(x[a]-x[b])+(y[a]-y[b])*(y[a]-y[b])+(z[a]-z[b])*(z[a]-z[b]);
            jl[a][b]=sqrt(c);
            b++;
        }
    }
    e=0;
    for(i=0;i!=-1;i++){
        for(a=0;a<n;a++){
        b=a+1;
          while(b<n){
            if(e<jl[a][b]){
                e=jl[a][b];
                o=a;
                p=b;
            }
                b++;
          }
        }
        if(e==0){
          break;
        }
        else{
          printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",x[o],y[o],z[o],x[p],y[p],z[p],e);    
          jl[o][p]=0;
          e=0;
        }
    }
    return 0;
}
double s[10][10];
int c[2];
int min(int n)
{int i,j;
double m=-1;
for (i=0;i<n-1;i++)
for (j=i+1;j<n;j++)
if (s[i][j]>m) {c[0]=i;c[1]=j;m=s[i][j];}
}
int main()
{int n,i,j,ll;
scanf("%d",&n);
int x[n],y[n],z[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]=1.0*(x[i]-x[j])*(x[i]-x[j])+1.0*(y[i]-y[j])*(y[i]-y[j])+1.0*(z[i]-z[j])*(z[i]-z[j]);
s[i][j]=sqrt(s[i][j]);
}
for (i=0;i<(n-1)*n/2;i++)
{min(n);
printf ("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",x[c[0]],y[c[0]],z[c[0]],x[c[1]],y[c[1]],z[c[1]],s[c[0]][c[1]]);
s[c[0]][c[1]]=-1;
} 
return 0;
}
int main(){
	int n,b=0,i;
	scanf("%d",&n);
	int x[10],y[10],z[10],k;
	double len[10][10],num[100],s;
	for(i=0;i<n;i++){
		scanf("%d %d %d",&x[i],&y[i],&z[i]);
	}
    for(i=0;i<n;i++){
		for(k=i+1;k<n;k++){
			len[i][k]=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]));
			num[b]=len[i][k];
			b++;
		}
	}
	for(k=1;k<=b;k++){
		for(i=0;i<(b-k);i++){
			if(num[i]>num[i+1]){
				s=num[i+1];
				num[i+1]=num[i];
				num[i]=s;
			}
		}
	}
	for(b;b>=0;b--){
        for(i=0;i<n;i++){
		    for(k=i+1;k<n;k++){
				if(num[b]==len[i][k]){
					printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",x[i],y[i],z[i],x[k],y[k],z[k],len[i][k]);
					break;
				}
			}
            if(num[b]==len[i][k]){
			   len[i][k]=10000000;
			   break;
			   }
		}
	}
	return 0;
}
int main(){
    int n;
    int N=1000;
    scanf("%d",&n);
    int a[n];int b[n];int c[n];int d[n];int e[n];int f[n];int h[N];int q[N];int j[N];int v[N];int l[N];int o[N];
    double g[N];
    
    for(int i=1;i<=n;i++){
        scanf("%d %d %d",&a[i-1],&b[i-1],&c[i-1]);
        d[i-1]=a[i-1];e[i-1]=b[i-1];f[i-1]=c[i-1];
    }
    int x=0;
    for(int i=1;i<n;i++){
        double p;
        int s;
        for(int t=i+1;t<=n;t++){
        s=((a[i-1]-d[t-1])*(a[i-1]-d[t-1]))*1.0+((b[i-1]-e[t-1])*(b[i-1]-e[t-1]))*1.0+((c[i-1]-f[t-1])*(c[i-1]-f[t-1]))*1.0;
        p=sqrt(s)*1.0;
        g[x]=p;h[x]=a[i-1];q[x]=b[i-1];j[x]=c[i-1];v[x]=d[t-1];l[x]=e[t-1];o[x]=f[t-1];
        x++;
        }
    }
    
    for(int k=1;k<=x;k++){
        for(int m=1;m<=(x-k);m++){
            if(g[m-1]<g[m]){double y;y=g[m-1];g[m-1]=g[m];g[m]=y;
                            int s;s=h[m-1];h[m-1]=h[m];h[m]=s;
                            s=q[m-1];q[m-1]=q[m];q[m]=s;
                            s=j[m-1];j[m-1]=j[m];j[m]=s;
                            s=v[m-1];v[m-1]=v[m];v[m]=s;
                            s=l[m-1];l[m-1]=l[m];l[m]=s;
                            s=o[m-1];o[m-1]=o[m];o[m]=s;
                            
                            
            }
        }
    }
    
    for(int z=1;z<=x;z++){
        printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",h[z-1],q[z-1],j[z-1],v[z-1],l[z-1],o[z-1],g[z-1]);
    }
    return 0;
}