int main()
{
	int f(int x);
	int num,i,a[10000]={0},b;
	scanf("%d", &num);
    for(i=1;i<=num;i++)
	{
		scanf("%d", &b);
		a[i]=f(b);
	}
	for(i=1;i<=num;i++)
	{
		printf("%d\n", a[i]);
	}
	return 0;
}
int f(int x)
{
	if(x==1 || x==2) return 1;
	else
	{
		int c;
		c=f(x-1)+f(x-2);
		return c;
	}
}


int f(int n)
{  if(n==1||n==2)return 1;
   else return f(n-2)+f(n-1);
}
main()
{int n,i,a[100],m;
scanf("%d",&n);
for(i=0;i<n;i++)
{scanf("%d",&a[i]);
 printf("%d\n",f(a[i]));
}
getchar();getchar();getchar();
}


int main()
{
	int n, m, i, x, y, temp;
	cin>>n;
	while(cin>>m)
	{
		x=1;
		y=1;
		for (i=0;i<m-2;i++)
		{
			x=y+x;
			temp=y;
			y=x;
			x=temp;
		}
	cout<<y<<endl;
	}
	return 0;
}


int F(int n);
int main(){
	int n;
	int bb[20],sl[20];
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%d",&bb[i]);
		sl[i]=F(bb[i]);
		printf("%d\n",sl[i]);
	}
	return 0;
}

int F(int n){
	int result;
	int sz[10000];
	    sz[0]=1,sz[1]=1;
	for(int r=2;r<10000;r++){
		sz[r]=sz[r-1]+sz[r-2];
	}
	for(int y=0;y<10000;y++){
		if(n==y+1){
			result=sz[y];
			break;
		}

	}
	return result;
}


int ferbo(int r)
{
    if(r==1||r==2)
    return 1;
    else
    return ferbo(r-1)+ferbo(r-2);
}
int main()
{
    int b[20],i,n;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        scanf("%d",&b[i]);
    }
    for(i=0;i<n;i++)
    {
        printf("%d\n",ferbo(b[i]));
    }
}


int fibo(int, int, int);

int main()
{
	int n, a;
	cin >> n;
	for (int i = 1; i <= n; i++)
	{
		cin >> a;
		cout << fibo(a, 1, 1) << endl;
	}
	return 0;
}

int fibo(int a, int b, int e)
{
	if (a <= 2)
		return e;
	else
		fibo(a - 1, e, b + e);
}


int fun(int n);
main()
{
   int n;
   scanf("%d",&n);
   int num;
   for(int i=0;i<n;i++)
   {
      scanf("%d",&num);
      printf("%d\n",fun(num));
   }
   getchar();
   getchar();
}
int fun(int n)
{
    if(n==1||n==2)  return 1;
    else
    {
       int sum=0;
       sum=fun(n-1)+fun(n-2);
       return sum;
    }
}


//??????
int fun(int n);
int main()
{
	int n = 0, i = 0, x = 0;
	cin >> n;
	for (i = 1; i <= n; i++)
	{
		cin >> x;
		cout << fun(x) << endl;
	}
	return 0;
}
int fun(int n)
{
	if (n == 1 || n == 2)
		return 1;
	else
		return fun(n - 1) + fun(n - 2);
}


int main()
{
int n,a,r=1,b,c,d,z,temp;
cin>>n;
for(r=1;r<=n;r++)
{
	cin>>a;
	b=c=1;
	for(temp=1;temp<=a;temp++)
	{
	z=b;
	d=b+c;
	b=c;
	c=d;
	}
	cout<<z<<endl;
}

return 0;
}


int f(int a)
{
	if(a==1)
		return 1;
	if(a==2)
		return 1;
	else
		return f(a-1)+f(a-2);
}
int main()
{
	int n=0,m=0;
	scanf("%d",&n);
	for(int i=0;i<n;i++)
	{
		cin>>m;
		printf("%d\n",f(m));
	}
	return 0;
}


int main()
{
int n;
cin>>n;
while(n--)
{
int a=0,b=1,c,num,re=0;
cin>>num;
num--;
while(num--)
{
c=b;
b=a+b;
a=c;
}
cout<<b<<endl;
}
return 0;
}


int main()
{
	int *a;
	int n,i;
	int x(int c);
	scanf("%d",&n);
	a=(int *)malloc(n*sizeof(int));
	for(i=0;i<n;i++)
	{
		scanf("%d",a+i);
	}
	for(i=0;i<n;i++)
	{
		printf("%d\n",x(*(a+i)));
	}
	return 0;

}
int x(int c)
{
	int r;
	if(c==1)
		return 1;
	else if(c==2)
		return 1;
	else
	{
		r=x(c-1)+x(c-2);
		return r;
	}
}


//?? - ??????

int main()
{
    int f(int);
    int n;
    int a;
    int i,j;
    scanf("%d",&n);
    printf("\n");
    for(i=0;i<n;i++)
    {
                    scanf("%d",&a);
                    printf("%d\n\n",f(a));

    }
    return 0;
}
int f(int a)
{
    if(a==1)return 1;
    if(a==2)return 1;
    else return f(a-1)+f(a-2);
}


int main()
{
	int a, n;
	cin >> n;
	while (n --)
	{
		cin >> a;
		if (a == 1)
			cout << 1 << endl;
		else if (a == 2)
			cout << 1 << endl;
		else
		{
			int a1, a2, a3;
			a1 = 1;
			a2 = 1;
			for (int i = 3; i <= a;	i ++)
			{
				a3 = a1 + a2;
				a1 = a2;
				a2 = a3;
			}
			cout << a3 << endl;
		}
	}
	return 0;
}


int value(int a){
	int p=1,q=1,i,result;
	if(a>=3){
		for(i=3;i<=a;i++){
			result=p+q;
			p=q;
			q=result;
		}
	}else{
		result=1;
	}
	return result;
}
int main(){
	int a,i,n,result;
	scanf("%d",&n);
	for(i=1;i<=n;i++){
		scanf("%d",&a);
		result=value(a);
		printf("%d\n",result);
	}
	return 0;
}


int fei(int m)
{
	if (m == 1)
		return 1;
	if (m == 2)
		return 1;
	return fei(m - 1) + fei(m - 2);
}
int main()
{
	int n, i, a[20], num;
	cin >> n;
	for (i = 0; i < n; i++)
	{
		cin >> a[i];
		num = fei(a[i]);
		cout << num << endl;
	}
	return 0;
}


//
//  main.cpp
//  10.15 homework
//  ??????

//  Created by airjcy on 10/8/12.
//  Copyright (c) 2012 airjcy. All rights reserved.
//

int main(int argc, const char * argv[])
{
    int n; //????
    cin >> n;
    int i;
    for (i = 0; i < n; i++) {
        int a = 1;
        int b = 1;
        int num; //??????
        cin >> num;
        int j;
        int t;
        for (j = 1; j < num; j ++) {
            t = b;
            b = a + b;
            a = t;
        }
        cout << a << endl;
    }

}


int compare(const void *a, const void *b)
{
	return *(int*)a - *(int *)b;
}

int main()
{
	int n, a[100], b;
	a[0] = 1, a[1] =1;
	cin >> n;
	for (int i = 2; i <= 30; i ++)
	{
		a[i] = a[i-1] + a[i-2];
	}
	for (int i = 0; i < n; i ++)
	{
		cin >> b;
		cout << a[b-1] << endl;
	}
	return 0;
}


int suan(int n,int *p)
{
    p=(int*)malloc(sizeof(int)*n);
    if(n==1||n==2)
    {
                  *(p+n-1)=1;
    }
    else
    {
        *(p+n-1)=suan(n-1,p)+suan(n-2,p);
    }
    return *(p+n-1);
}
int main()
{
    int b,n,i;
    scanf("%d",&b);
    for(i=0;i<b;i++)
    {
    scanf("%d",&n);
    int a[n];
    int *p;
    p=a;
    printf("%d\n",suan(n,p));
    }
    getchar();
    getchar();
    getchar();
    }


int main()
{
	int casenum;
	cin >> casenum;
	int f[100];
	f[0] = 0;
	f[1] = 1;
	int i;
	for(i = 2;i <= 20; i ++)
	{
		f[i] = f[i-1] + f[i-2];
	}
	while(casenum--)
	{
		int a;
		cin >> a;
		int i,j;
		cout<<f[a]<<endl;
	}
	return 0;
}


int fib(int n)
{
	if (n == 1)
		return 1;
	if (n == 2)
		return 1;
	return fib(n - 1) + fib(n - 2);
}
int main()
{
	int n, k;
	cin >> n;
	while (n--)
	{
		cin >> k;
		cout << fib(k) << endl;
	}
	return 0;
}


int Fibonacci(int n);
int main(){
	int n,i,j,sz[20];
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&j);
		sz[i]=Fibonacci(j);
		printf("%d\n",sz[i]);
	}
	return 0;
}
int Fibonacci(int n){
	int s1,s2,s3,i;
	if(n==1){
		return 1;
	}
	if(n==2){
		return 1;
	}
	s1=1;
	s2=1;
	for(i=0;i<n-2;i++){
		s3=s2+s1;
		s1=s2;
		s2=s3;
	}
	return s3;
}


int f(int n)
{
   if (n==1)
      return 1;
   else if (n==2)
      return 1;
   else if (n>2)
      return(f(n-1)+f(n-2));
}
int main()
{
   int m,a;
   scanf("%d",&m);
   while (m--)
   {
      scanf("%d",&a);
      printf("%d\n",f(a));
   }

}


void main()
{
	int a,k,i,n;
	int zhaodao(int a);
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{

	scanf("%d",&a);
	k=zhaodao(a);
	printf("%d\n",k);
	}
}
int zhaodao(int a)
{
	if(a==1||a==2)
		return(1);
	else
		return(zhaodao(a-1)+zhaodao(a-2));
}


int a[100] = {0};
int f(int num)
{
	if (a[num] == 0)
		return (f(num - 1) + f (num - 2));
	else
		return a[num];
}
int main()
{
	a[1] = 1;
    a[2] = 1;
	int num, n;
	cin >> n;
	for (int i = 1; i <= n; i++)
	{
		cin >> num;
	    cout << f(num) << endl;
	}
	return 0;
}


int main()
{
    int data[20] = {1,1};
    int n;
    int a;
    int i, j;

    for(j = 2; j <= 19; j++)
                data[j] = data[j - 2] + data[j - 1];

    scanf("%d", &n);

    for(i = 0; i <= n - 1; i++)
    {
          scanf("%d", &a);
          printf("%d\n", data[a - 1]);
    }

    return 0;
}


int f(int a);
int main()
{
   int n,a,i;
   scanf("%d",&n);
   for(i=1;i<=n;i++){
       scanf("%d",&a);
       printf("%d\n",f(a));
   }
   return 0;
}
int f(int a){
    if(a==1||a==2){
       return 1;
    }
    int b,c,d,k;
    c=1;
    d=1;
    for(k=3;k<=a;k++){
        b=c;
        c=d;
        d=b+c;
    }
    return d;
}


int f(int n)
{
	if(n==1)
	{
		return 1;
	}
	else if(n==2)
	{
		return 1;
	}
	else
	{
		return(f(n-1)+f(n-2));
	}
}
int main()
{
	int n=0,a=0;
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>a;
		cout<<f(a)<<endl;
	}
	return 0;
}


int fib(int i)
{
    int a = 0, b = 1;
    while (--i) {
        a = a + b;
        swap(a, b);
    }
    return b;
}

int main()
{
    int n;
    cin >> n;
    while (n--) {
        int i;
        cin >> i;
        cout << fib(i) << endl;
    }
    return 0;
}


int main()
{
int k;
cin>>k;
int b[k];
for(int i=0;i<k;i++)
{int a;
cin>>b[i];
double n;
n=b[i];
a=sqrt(5);
a=((pow(((1+sqrt(5))/2),n)-(pow(((1-sqrt(5))/2),n)))/sqrt(5));
cout<<a<<endl;
}
return 0;
}


int a[100];
int F(int n)
    { if(n==1||n==2)return 1;
     else return F(n-1)+F(n-2);
     }
int main()
{ int n;
 cin>>n;
 for(int i=0;i<n;i++)
    {
    cin>>a[i];
    }
 for(int j=0;j<n;j++)
    {cout<<F(a[j])<<endl;
    }
 return 0;
}


int ans[21];

int work(int a)
{
	if (a <= 2)
		return 1;
	return (work(a - 1) + work(a - 2));
}

int main()
{
	int n, a;
	int i;
	cin >> n;
	for (i = 1; i <= n; i++)
	{
		cin >> a;
		cout << work(a) << endl;
	}
	return 0;
}


int F(int a);
int main()
{
	int n,a,i,sz[20],result;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&a);

		result=F(a);
		printf("%d\n",result);
	}
	return 0;
}
int F(int a){
	int result,i,st[20];
	st[0]=0;
	st[1]=1;
	for(i=2;i<=a;i++){
		st[i]=st[i-1]+st[i-2];
	}
	result=st[a];
	return result;
}


int f(int x)
{
	if (x > 2)
		return (f(x - 1) + f(x - 2));
	if (x == 1)
		return 1;
	if (x == 2)
		return 1;
}

int main()
{
	int n, x;
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		cin >> x;
		cout << f(x) << endl;
		cout << endl;
	}
	return 0;
}


/*
 * Filename:parctice_fibonacciarray.cpp
 * Author: Wu Yiming
 *  Created on: 2011-11-2
 *  Function: find certain number in Fibonacii array
 */

int main()
{
	int n,pos,i;
	cin>>n;
	int fib[21]={1,1};
	while (n)
	{
		cin>>pos;
		for(i=2;i<pos;i++)
			fib[i]=fib[i-1]+fib[i-2];
		cout<<fib[i-1]<<endl;
		n--;
	}
	return 0;
}


//
//  main.cpp
//  poj
//
//  Created by ChuPan,Wong on 9/27/13.
//  Copyright (c) 2013 ChuPan,Wong. All rights reserved.
//

int main(int argc, const char * argv[])
{
    int num[20];
    num[0]=num[1]=1;
    for(int i=2;i<20;i++){
        num[i] = num[i-1]+num[i-2];
    }
    int n;
    cin>>n;
    int x;
    while(n--){
        cin>>x;
        cout<<num[x-1]<<endl;
    }
    return 0;
}


int add(int a1,int b1);
int main()
{
	int q,p,n,result,i,a,k,sz[1000];
	scanf("%d",&n);
	for(k=0;k<n;k++)
	{
		scanf("%d",&a);
		p=1;
		q=1;
	    for(i=2;i<a;i++)
		{
		  result=add(p,q);
		  p=q;
		  q=result;
		}
		if(a==2||a==1)
		{
		  sz[k]=1;
		}
		else
		{
			sz[k]=result;
		}
	}
	for(k=0;k<n;k++)
	{
	  printf("%d\n",sz[k]);
	}
    return 0;
}

int add(int a1,int b1){
	int s;
	s=a1+b1;
	return s;
}


int f(int x)
{
    int a[1000]={1,1};
    for(int i=2;i<x;i++)
    a[i]=a[i-1]+a[i-2];
    return a[x-1];
}
int main()
{
  int n;
  scanf("%d",&n);
  int b[1000];
  for(int i=0;i<n;i++)
  scanf("%d",&b[i]);
    for(int i=0;i<n;i++)
  printf("%d\n",f(b[i]));
  getchar();
  getchar();
}


int fac(int);

int main()
{
	int n, y, times;
	cin >> times;
	for (int i = 0; i < times; i++)
	{
	    cin >> n;
	    y = fac(n);
	    cout << y << endl;
	}

	return 0;
}

int fac(int n)
{
	if (n == 1 || n == 2)
		return 1;
	else
		return fac(n - 1) + fac(n - 2);
}


int main(int argc, char *argv[])
{
    int n;
    scanf("%d",&n);
    int shulie[20];
    int i;
    shulie[0]=1;
    shulie[1]=1;
    for(i=2;i<=19;i++){
        shulie[i]=shulie[i-1]+shulie[i-2];
    }
    int ceshi[n];
    for(i=0;i<n;i++){
        scanf("%d",&ceshi[i]);
    }
    for(i=0;i<n;i++){
        printf("%d\n",shulie[ceshi[i]-1]);
    }
  return 0;
}


int main()
{
    int f(int);

    int n, i, a;

    cin >> n;

    for(i = 0; i < n; i++)
    {
        cin >> a;

        a = f(a);

        cout << a << endl;
    }

    return 0;
}

int f(int a)
{
    if(a == 1 || a == 2) return 1;
    else
    {
        return f(a - 1) + f(a - 2);
    }
}


int f(int n)
{
 if(n==1)
  return 1;
 else if(n==2)
  return 1;
 else
  return f(n-1)+f(n-2);
}
int main()
{
 int n,i,a[10000];
 scanf("%d",&n);
 for(i=0;i<n;i++)
  scanf("%d",&a[i]);
 for(i=0;i<n;i++)
 {
  printf("%d\n",f(a[i]));
 }
 getchar();
 getchar();
 return 0;
}


int f(int n)
{
    int c;
    if(n==1||n==2)
    c=1;
    else
    c=f(n-1)+f(n-2);
    return(c);
}
main()
{
      int n,i,m;
      int f(int n);
      scanf("%d",&n);
      for(i=0;i<n;i++)
      {
             scanf("%d",&m);
             printf("%d\n",f(m));
      }
      getchar();
      getchar();
}


//1200012979
int look(int);
int main()
{
	int n, a, count=0;
	cin >> n;
	while(count < n)
	{
		count++;
		cin >> a;
        cout << look(a)<< endl;
	}
	return 0;
}

int look(int a)
{
	if(a < 3)
		return 1;
	else
	return look(a-1)+look(a-2);
}


int fei(int a)
{
	if (a == 1 || a == 2)
	{
		return 1;
	}
	else
	{
		return fei(a - 1) + fei(a - 2);
	}
}
int main()
{
	int n, i, m;
	cin >> n;
	for (i = 1; i <= n; i++)
	{
		cin >> m;
		cout << fei(m) << endl;
	}
	return 0;
}


int main(){
char zf[200];
gets(zf);
int i=0;
int k;
int s,b;
int len=strlen(zf);
while(zf[i]){
	if(zf[i]==' '&&zf[i+1]==' '){
     b=i;
	 k=i;
	while(zf[k]==' '){
     k=k+1;
	}
	s=k-i;
	while(b<=len-s){
		zf[b+1]=zf[b+s];
		b++;

	}
	len=len-s+1;
	}
	i=i+1;

}

printf("%s",zf);

return 0;
}


void main()
{
	char a;
	int i=0;
	for(;a!='\n';)
	{
	a=getchar();
	if(a!=' ')
	{printf("%c",a);i=0;}
	else if((a==' ')&&(i==0))
	{i++;printf("%c",a);continue;}
	else continue;
	}
}


int main(){
	char suoyou[200];
	gets(suoyou);
	int i,n;
	int a,l=0;
	n=strlen(suoyou);
	for(i=1;i<n;i++){
		if(suoyou[i-1]==' '){
			if(suoyou[i]==' '){
				for(a=i-1;a<n;a++){
					suoyou[a]=suoyou[a+1];
					suoyou[n-l]='\0';

				}
				l++;
				i--;
			}
		}
	}
	puts(suoyou);
	return 0;
}


int main()
{
    char *p;
    int i;
    void guolv(char *p);
    p=(char *)malloc(1000);
    gets(p);
    guolv(p);
        return 0;
}

void guolv(char *p)
{
     int i;
     for(i=0;(*(p+i))!='\0';i++)
     {
                                if(((*(p+i))==' ')&&((*(p+(i+1)))==' '));
                                else
                                printf("%c",*(p+i));
     }
}


main()
{
 char str[1000]={""};
 gets(str);
 int len=strlen(str);
 int i;
 for(i=0;str[i]!='\0';i++)
 {
  int j=i;
  if(str[i]==' ')
  {
  i++;
  while(i<len)
  {
   if(str[i]==str[i-1])
   i++;
   else
   {i--;break;}
  }
  }
  printf("%c",str[j]);

 }
}


char a[1000];

int main()
{
    gets(a);
    char *p = a;
    cout << *p;
    for(int i = 1; i < strlen(a); i++){
        if(*(p+i-1)==' '&&*(p+i)==' ')
            continue;
        cout << *(p+i);
    }
}


void del(char a[100],int k,int n)
{
	int i;
	for (i=k;i<=n;i++) a[i]=a[i+1];
}

int main()
{
	char a[100]; int i,n;
	gets(a); n=strlen(a);
	i=1;
	while (i<=n)
		if ((a[i-1]==' ')&&(a[i]==' '))
		{
			del(a,i,n);
			n--;
		} else i++;
	puts(a);
	return 0;
}


int main(int argc, char* argv[])
{ int q=0,i,j;
char tra[1000],yaode[1000];
gets(tra);
for(i=0,j=0;i<1000;i++)
if(tra[i]!=' '){
		yaode[j]=tra[i];
	    j++;
		q=0;
	}
	else
		if(tra[i]==' '&&q==0){
			yaode[j]=tra[i];
			q++;
			j++;
		}
		else
			if(tra[i]=='.'){
				yaode[j]=tra[i];
				break;
			}
			printf("%s",yaode);

	return 0;
}


int main()
{
	char old[200],wri[200];
	int a,b;
	gets(old);
	b=0;
	for(a=0;old[a]!='\0';a++)
	{
		if(old[a]!=' '){
			wri[b]=old[a];
			b++;
		}
		else{
			if(old[a+1]!=' ')
			{
				wri[b]=old[a];
				wri[b+1]=old[a+1];
				b=b+2;
				a++;
			}
			else
				continue;
		}
	}
	wri[b]='\0';
	puts(wri);
	return 0;
}


int main(){
    const int MAXN = 300;
    char str[MAXN];
    gets(str);
    int i;
    printf("%c", str[0]);
    for (i = 1; i < strlen(str); ++ i)
        if (str[i - 1] == ' ' && str[i] == ' ')
           continue;
        else
            printf("%c", str[i]);
    printf("\n");
    return 0;
}


int main()
{
	char ch[100];
	int i,j=0,k=0;
	while(k<100)
	{
		ch[k]=getchar();
		if(ch[k]=='\n')
		break;
		k++;
	}
	for(i=0;i<k;i++)
	{
		if(ch[i]==32)
			j++;
		else
			j=0;

        if(j<2)
			printf("%c",ch[i]);
	}
	return 0;
}


int main(){
	char zfc[1000];
	int i;
	gets(zfc);
	for(i=0;zfc[i]!='\0';i++){
		if(zfc[i]!=' '){
			printf("%c",zfc[i]);
		}else{
			if(zfc[i+1]==' '){
				continue;
			}else{
				printf(" ");
			}
		}
	}
	return 0;
}


int main(){
	int i,j=0;
	char zfc[100],guolv[100];
	gets(zfc);
	for(i=0;;i++){
		if(zfc[i]==0){
			guolv[j]=0;
			puts(guolv);
			break;
		}else if(zfc[i]==' '&&zfc[i+1]==' '){
           continue;
		}else{
           guolv[j]=zfc[i];
		   j++;
		}
	}
	return 0;
}


int main()
{
	char a[202];
	cin.getline(a,202);
	char *p = NULL ;
	p = a;
	int l;
	l = strlen(a);
	int k = 1;
	while ( *p !='\0')
	{
		if (k==1)
		{
			cout << *p;
			if (*p==' ')
			{
			k = 0;
			}
		    p++;
		}
		else
		{
			if (*p==' ')
			{
				p++;
				continue;
			}
			else
			{
				cout<< *p;
				k = 1;
		        p++;
			}
		}
	}

}


int main()
{
	int i=0,n;
	char ch[500];
    while(1)
	{
		ch[i]=cin.get();
		if(ch[i]=='\n')
			break;
		else if(ch[i]!=' ')
			i++;
		else if(ch[i-1]!=' ')
			i++;
	}
	n=i;
	for(i=0;i<n;i++)
		cout<<ch[i];
	return 0;
}


//
//  main.cpp
//  ?????
//
//  Created by ???? on 13-11-28.
//  Copyright (c) 2013? ????. All rights reserved.
//

int main()
{
    char sen[500];
    char *p;
    cin.getline(sen,500);
    p=sen;
    for(;*p;p++)
    {
        int flag;
        if(*p!=' '){cout<<*p;flag=0;}
        if(*p==' '&&flag==0){cout<<*p;flag++;}
        if(*p==' '&&flag>0)continue;
    }

        return 0;
}


int main()
{
	char str[100];
	int i=0;
	int flag=0;
	gets(str);
	while(str[i]!=0)
	{
		if(str[i]==' ')
			if(flag==0)
			{
				flag=1;
				cout<<str[i];
			}
			else;
		else
		{
			flag=0;
		    cout<<str[i];
		}
		i++;
	}
	return 0;

}


int main ()
{
	int i,b=0;
	char a[1000];
	gets(a);
	for(i=0;i<1000;i++)
	{

		if(a[i]=='\0')
		{printf ("\n");break;}

		if(a[i]!=' ')
		{
			b=0;
			printf ("%c",a[i]);
		}
		else
			b=b+1;

		if(b==1)
			printf (" ");
		else
			continue;
	}
	return 0;
}


int main()
{
	char str[101];
	char *p;
	int i;
	cin.getline(str,101);
	for(i=0;i<strlen(str);i++)
	{
		if(str[i]!=' ')
		{
			p=&str[i];
			cout<<*p;
			continue;
		}
		if(str[i]==' ')
			if(str[i-1]!=' ')
			{
				p=&str[i];
				cout<<*p;
				continue;
			}
	}
	cout<<endl;
	return 0;
}


int main(){
	char zfc[250];
	gets(zfc);
	int n=strlen(zfc);
	for(int i=0;i<n;i++){
		if(i==0){
			printf("%c",zfc[0]);
		}else if(zfc[i]!=' '){
			printf("%c",zfc[i]);
		}else if(zfc[i-1]!=' '){
			printf("%c",zfc[i]);
		}
	}
	return 0;
}


int main()
{
	char input[100];
	char *p = NULL;
	int i;
	int length;
	p = input;
	cin.getline(input, 100);
	length = strlen(input);
	cout << input[0];
	for (i = 1; i < length; i++)
	//for (p = input; p < length; p++)
	{
		p++;
		if (*p == ' ' && *(p - 1) == ' ')
				continue;
		cout << *p;
	}
	return 0;
}


int main()
{
	char a[1000],t;
	int i=0;
	t=getchar();

	while(t>20)
	{
		while(t!=' ')
		{
			a[i]=t;
			t=getchar();
			i++;
			if(t<33)break;
		}
		if(t<32)break;
		while(t==' ')t=getchar();
		a[i]=' ';
		i++;
	}
	for(int k=0;k<i;k++)
		cout<<a[k];
	return 0;
}


int main()
{
	char *str,*p,*start;
	str=(char *)calloc(1000,sizeof(char));
	gets(str);

	int countspace=0;
	start=str;

	for (p=str;*p!='\0';p++)
		if (*p==' ')
		{
			if (*(p-1)!=' ') start=p;
			countspace++;
			if (*(p+1)!=' ')
			{
				if (countspace>1)
					for (p=start+1;*(p-1)!='\0';p++)
						*p=*(p+countspace-1);
				countspace=0;
				p=start+1;
			}
		}

	puts(str);
	free(str);
	return 0;
}


int main() {

	char ch[1000];
	//scanf("%s", ch);
	gets(ch);
	int len = strlen(ch);

	int i;
	for(i = 0; i < len; i++) {
		if(ch[i] != ' ') {
			printf("%c" , ch[i]);
		} else {
			if(ch[i-1] == ' ') {

			} else {
				printf(" ");
			}
		}
	}

	printf("\n");

	return 0;
}


int main(){
    int n;
    int m=0;
    int j=0;
    char zfc[202];
    char mb[202];
    gets(zfc);
    n=strlen(zfc);
    for(int i=0;i<n;i++){
        if(!(zfc[i]==' '&&zfc[i+1]==' ')){
             mb[j]=zfc[i];
             j++;
        }
    }
    mb[j]='\0';
    printf("%s",mb);
    return 0;
}


int main(){
	char zfc[256],str[256]={0};
	gets(zfc);
	int len=strlen(zfc),k=0;
	for(int i=0;i<len;i++){
		if(zfc[i]==' '&&zfc[i+1]==' '){
			continue;
		}else{
			str[k]=zfc[i];
			k++;
		}
	}
	puts(str);
	return 0;
}


int main()
{
	int n,kongge=0;
	char a[200];
	gets(a);
	n=strlen(a);
	for (int i=0;i<n;i++)
	{
		if(a[i]!=' ')
		{
			printf("%c",a[i]);
			kongge=0;
		}
		else if(kongge==0)
		{
			printf(" ");
			kongge+=1;
		}
	}

	return 0;
}


/*
 * homework3.cpp
 *
 *  Created on: 2012-12-4
 *      Author: Lixurong
 */

int main()
{
	char a[1000];
	cin.getline(a,1000);
	int p=0, len=strlen(a);
	for( int i=0; i<len; i++ )
	{
		if( *(a+i) != ' ' )
		{
            p=0;
		}
		else if(p==1)
		{
			for( int j=i; j<len-1; j++ )
			{
				*(a+j)=*(a+j+1);
			}
			len--;
			i--;
		}
		else
		{
			p=1;
		}
	}
	*(a+len)='\0';
	cout << a;
}


int main()
{
	int i, j;
	char str[50][20], s;
	for(i=0;;i++)
	{
		scanf("%s",str[i]);
		if(s=getchar()=='\n')break;

	}
	for(j=0;j<i;j++)
	{
		printf("%s ", str[j]);
	}
	printf("%s", str[i]);
	return 0;
}


int main()
{
    char sentence[10000];
    int i, j;
    cin.getline(sentence, 10000);
    for (i = 0; i < strlen(sentence); )
    {
        if (sentence[i] != ' ')
        {
            cout << sentence[i];
            i++;
        }
        else
        {
             do
             {
                 i++;
             } while(sentence[i] == ' ');
             cout << ' ';
        }
    }

    return 0;
}


void main()
{
   char *str,*p;
   str=(char *)malloc(100*sizeof(char));
   gets(str);
   p=str;
   for (;*p!='\0';p++)
       {  if(*p!=' ') printf("%c",*p);
          else if(*(p-1)!=' ') printf(" ");
        }
}


/*
 * ???????.cpp
 *  Created on: 2012-12-11
 *  Author: ???
 */
int main() {
	int n;
	char a[100], *p = a;
	cin >> a;
	n = strlen(a);
	for (int i = 0; i < n; i++) {
		cout << *(p + i);
	}
	while (cin >> a) {
		cout<<' ';
		n = strlen(a);
		for (int i = 0; i < n; i++) {
			cout << *(p + i);
		}
	}
	return 0;
}


int main()
{
	char sentence[100] ;
	char *pos = NULL ;
	cin.getline(sentence , 100) ;
	int len = strlen(sentence) ;
	cout << sentence[0] ;
	for ( pos = &sentence[1] ; pos < &sentence[len] ; pos++ )
	{
		if ( *pos == ' ' && *(pos-1) == ' ' )
			continue ;
		else
			cout << *pos ;
	}
	cout << endl ;
	return 0 ;
}


int main(){
     char first,second;
     first=getchar();
     printf("%c",first);
     second=getchar();
     while (second!=EOF){
       if (!(first==' '&&second==' '))
         printf("%c",second);
       first=second;
       second=getchar();
       }
     return 0;
     }


int main()
{
    char c;
    int flag = 0;
    for (;;)
    {
        c = cin.get();
        if (c == '\n') break;
        if (c != ' ') {cout << c; flag = 0;}
        else
        {
            if (flag) continue;
            else
            {
                flag = 1;
                cout << c;
            }
        }
    }

    return 0;
}


int main()
{
	char str[300];
	int i;
	char c;
	gets(str);
	for(i=0;(c=str[i])!='\0';i++)
	{
		if((c=str[i])==32)
		{
			if((c=str[i-1])==32)
				continue;
		}
		printf("%c",str[i]);
	}
	printf("\n");
	return 0;
}


int main()
{
	char origin[100];
	char transfer[100];
	cin.getline(origin, 101);
	char *p = origin;
	char *q = transfer;
	int n = 0;
	for (int i = 0; i < strlen(origin); i++)
	{
		if (*p == ' '&& *(p-1) == ' ')
			p++;
		else
		{
			*q = *p;
			n++;
			q++;
			p++;
		}
	}
	q = transfer;
	for (int i = 1; i <= n; i++)
	{
		cout << *q;
		q++;
	}
	cout << endl;
	return 0;
}


int main (){
    int n,i,k=1,len;
    char zfc[201],sz[201]={0};
    gets(zfc);
    len=strlen(zfc);
    sz[0]=zfc[0];
    for(i=1;i<len;i++){
        if(zfc[i-1]==' '&&zfc[i]==' '){
        }else{
            sz[k]=zfc[i];
            k++;
        }
    }
    printf("%s",sz);
    return 0;
}


int main()
{
    char str[1000];
    memset(str, 0, sizeof(str));
    cin.getline(str, 1000, '\n');
    for (int i = 0; str[i]; i ++)
    {
        if (str[i] != ' ')
            cout << str[i];
        else
        {
            if (str[i + 1] != ' ')
                cout << str[i];
         }
    }
    cout << endl;
    return 0;
}


main(void)
{
 int space=1,i=-1;
 char a[80];
 gets(a);

 while(a[++i]!='\0')
 {
  if(a[i]==' ') space=0;
  else
  {
   if(space==0)
   { space=1;printf(" ");}
      printf("%c",a[i]);
  }
 }
}


int main()
{
	char in[200],out[200];
	int len,i,j=0;
	gets(in);
	len=strlen(in);
	for(i=0;i<len;i++)
		if(in[i]!=' ')
			out[j++]=in[i];
		else
			if(in[i+1]!=' ')
				out[j++]=' ';
			else
				continue;
	out[j]='\0';
	puts(out);
	return 0;
}


int main()
{
char c[100];
cin>>c;
cout<<c;
char a[100];
while(cin>>a)
{
cout<<' '<<a;
memset(a,0,sizeof(a));
}
}


int main()
{
    int i, len;
    char str[200];
    cin.getline(str,200);
    len=strlen(str);
    cout<<str[0];
    for(i=1;i<=len-1;i++)
    {
        if(str[i]!=' ' && str[i-1]==' ')
            cout<<" "<<str[i];
        else if(str[i]!=' ' && str[i-1]!=' ')
            cout<<str[i];
    }
    int x;cin>>x;
    return 0;

    }


int main(){
    int i=0,flag=0;
    int c;
    c=getchar();
    while (c!=EOF){
        if (flag==0&&isgraph(c)) printf("%c",c);
          else if (flag==0){
               printf("%c",c);
               flag=1;
               }
               else if (isgraph(c)){
                    printf("%c",c);
                    flag=0;
                    }
        c=getchar();
        i++;
        }
}


/*
 * extra.cpp
 * ???????
 *  Created on: 2012-11-21
 *      Author: ???
 */
int main() {
	int i;
	char str[100];
	cin.getline(str, 100);
	cout << str[0];
	for (i = 1; i < strlen(str) - 1; i++) {
		if (str[i] != ' ') {
			cout << str[i];
		} else if (str[i] == ' ' && str[i + 1] == ' ') {
			continue;
		} else if (str[i] == ' ' && str[i + 1] != ' ') {
			cout << ' ';
		}
	}
	cout << str[strlen(str) - 1];
	return 0;
}


int main()
{
	char str[100],ch[100];
	memset(ch,0,sizeof(ch));
	memset(str,0,sizeof(str));
	cin.getline(str,100);
	int i,j=0,flag=0;
	for(i=0;str[i] != '\0';i++)
	{
		if(str[i]==' ' && flag==0)
		{
			flag++;
			ch[j++] = str[i];
		}
		if(str[i]!=' ')
		{
			ch[j++]=str[i];
			flag=0;
		}
	}
	cout<<ch<<endl;
	return 0;
}


int main()
{
	char *p;
	int i,j,k,num=0;
	p=(char *)malloc(10000*sizeof(char));
	gets(p);
	for (i=0;i<strlen(p)-num;i++)
	{
		if (*(p+i)==' '&&*(p+i+1)==' ')
		{
			k=i;
			for (j=i+1;j<strlen(p)-num;j++,i++)
				*(p+i)=*(p+j);
			num++;
			i=k-1;
		}
	}
	for (i=0;i<strlen(p)-num;i++)
		printf("%c",*(p+i));
	return 0;
}


int main()
{
	char a[101];
	int b[101];
	int lenth,i;
	char c=' ';
	gets(a);
	lenth=strlen(a);
	for(i=0;i<lenth;i++)
	{
		b[i]=1;
	}
	for(i=0;i<lenth;i++)
	{
		if(a[i]==c&&a[i-1]==c)
			b[i]=0;
	}
	for(i=0;i<lenth;i++)
	{
		if(b[i]==1)
			printf("%c",a[i]);
	}
	return 0;
}


/*
 *???: delete blank.cpp
 *??????
 *????: 2012-12-10
 *??: ??????
 */

int main ()
{
    char sentence[1000];
    //????
    cin.getline(sentence,1000);
    for (int i = 0; i <= strlen(sentence); i++){
        if (*(sentence+i) == ' '){
            int j;
            for (j = i; ; j++)
                if (*(sentence+j+1) != ' ') break;
            for (int k = 0; k <= strlen(sentence)-i+1; k++)
                *(sentence+k+i) = *(sentence+j+k);
        }
    }
    cout << sentence;
    return 0;
}


int main()
{
	char a, b;
	cin >> a;
	b = a;
	cout << a;
	while (cin.get(a))
	{
		if (a != ' ' || (a == ' ' && b != ' '))
		{
			cout << a;
			b = a;
		}
	}
	return 0;
}


int main(){
    char sen[MAX][MAX]={0};
	int i,e;
    for(i=0;i<MAX;i++){
		scanf("%s",sen[i]);
	}
	printf("%s",sen[0]);
	for(i=1;sen[i][0];i++){
		printf(" %s",sen[i]);
	}
	return 0;
}


int main()
{
	char word_in[1000],word_out[1000];
	int sum,k=0;
	for(int i=0;i<1000;i++)
	{
		word_in[i]=0;
		word_out[i]=0;
	}
	cin.getline(word_in,1000);
	sum=strlen(word_in);
	for(int i=0;i<sum;i++)
	{
		if(word_in[i]!=32)
		{
			word_out[k]=word_in[i];
			k++;
		}
		if(word_in[i]==32)
		{
			if(word_in[i+1]!=32)
			{
				word_out[k]=word_in[i];
				k++;
			}
		}
	}
	sum=strlen(word_out);
	for(int i=0;i<sum;i++)
	{
		cout<<word_out[i];
	}
	return 0;
}


int main()
{
	char zfc[500];
	gets(zfc);
	int i,k,LEN;
	LEN=strlen(zfc);
	for(i=0;i<LEN-1;i++)
	{
		if(zfc[i]==' '&&zfc[i+1]==' ')
		{
			for(k=i+1;k<LEN-1;k++)
			{
				zfc[k]=zfc[k+1];
			}
			i=i-1; zfc[LEN-1]='\0';
		}

		LEN=strlen(zfc);
	}

	puts(zfc);
	return 0;
}


//
//  main.cpp
//  ????
//
//  Created by ? ? on 12-11-22.
//  Copyright (c) 2012? ? ?. All rights reserved.
//

int main()
{char str1[100],str2[100];
    int i,k=0,p,t=0;
    gets(str1);
    int len1=strlen(str1);
    for(i=0;t<len1;i++,t++)
    {
        if (str1[t]==' ') {
            for(p=t+1;str1[p]==' ';p++)
                t++;
        }
        str2[i]=str1[t];

    }
    for(p=0;p<i;p++)
    cout<<str2[p];
    return 0;
}


int main()
{
        char a,b;
        int i=1;

        b=60;
        for(;i>0;i++)
        {
                a=cin.get();
                if(a=='\n') break;
                if(a!=' '||b!=' ') cout<<a;
                b=a;
        }
        return 0;
}


int main()
{
	int i,j;
	char zfc[1000];
	gets(zfc);
	for(i=0;zfc[i]!='\0';i++){
		if(zfc[i]!=' '){
		    printf("%c",zfc[i]);
		}else if(zfc[i]==' '){
			if(zfc[i+1]!=' '){
				printf(" ");
			}else{
				continue;
			}
		}
	}
	return 0;
}


int main()
{
	char a[100],b;
	int i1=0;
	while (cin.get(b)&&b!='\n')
		a[i1++]=b;//shuruzifuchuan
	char c[100];
	int j=0;
	for (int i2=0;i2<=i1-1;i2++)
	{
		if (a[i2]==32&&a[i2+1]==32)
			continue;//duogekonggexianglin,zhiquyige
		else
			c[j++]=a[i2];
	}
	for (int k=0;k<=j-1;k++)
		cout<<c[k];
	return 0;
}


int main()
{
	char a[200];
	int i,b;

	gets (a);
	b=strlen(a);

	for (i=0;i<b;i++)
	{
		if (a[i]!=' ')
			printf("%c",a[i]);
		else if(a[i]==' '&& a[i+1]==' ')
		{
			continue;
		}
		else
		{
			printf(" ");
		}
	}

	return 0;
}


int main()
{

	char str[255];
	char words[255][255];
	int index = 0;

	// ????
	while (scanf("%s", str))
	{
		strcpy(words[index++], str);

		char c = getchar();
		if (c == '\n')
			break;
	}

	//// ??
	//for (int i = 1; i < index; i++)
	//{
	//	for (int j = 0; j < index-i; j++)
	//	{
	//		if (strcmp(words[j], words[j+1]) > 0)
	//		{
	//			strcpy(str, words[j+1]);
	//			strcpy(words[j+1], words[j]);
	//			strcpy(words[j], str);
	//		}
	//	}
	//}

	//// ??????
	//char newWords[255][255];
	//int newIndex = 0;

	//strcpy(newWords[newIndex++], words[0]);
	//for (int i = 1; i < index; i++)
	//{
	//	//printf("%s\n", words[i]);
	//	if (strcmp(words[i], words[i-1]) != 0)
	//	{
	//		strcpy(newWords[newIndex++], words[i]);
	//	}
	//}

	// ????
	for (int i = 0; i < index; i++)
	{
		printf("%s", words[i]);
		if (i == index-1)
			printf("\n");
		else
			printf(" ");
	}

	return 0;
}


int main()
{
    char ch;
    int flag=0;
    while((ch=getchar())!='\n')
    {
             if(ch==' '&&flag==0)
             {
                      putchar(ch);
                      flag=1;
             }
             else if(ch!=' ')
             {
                  flag=0;
                  putchar(ch);
             }
   }
   getchar();
   getchar();
   getchar();
}


int main(){
   char pSource[100];
   gets(pSource);

char arrSentence[100] = {0};
int i = 0 ,j = 0;
int nSpace = 0;
while ( pSource[i] != 0 )
{
 if ( nSpace < 1 )
 {
  arrSentence[j++] = pSource[i];
 }
 if ( pSource[i] == ' ' )
 {
  nSpace ++;
  if ( pSource[i+1] != ' ' )
  {
   nSpace = 0;
  }
 }
 i++;
}
printf("%s\n" ,arrSentence);
return 0;
}


int main(){
     char a[1000];
     char *p=a;
     int len;

     gets(a);
     len=strlen(a);

     while (p<a+len)
     if ((*p==' ')&&(*(p+1)==' ')) p++;
     else {cout<<*p; p++;}
     return 0;
}


int main()
{
	char input[100];
	int i;
	int flag[100] = {0}, length;
	cin.getline(input, 100);
	length = strlen(input);
	cout << input[0];
	for (i = 1; i < length; i++)
	{
		if (input[i] == ' ' && input[i - 1] == ' ')
		{
				continue;
		}
		cout << input[i];
	}
	return 0;
}


void main()
{
	char *str;
	int i,t=0,n;
	str=(char *)malloc(100*sizeof(char));
	gets(str);
	n=strlen(str);
	for (i=1;i<n;i++)
	{
		if (*(str+i)==' '&&*(str+i-1)==' ')
			t=t+1;
		else
			*(str+i-t)=*(str+i);
	}
	for (i=0;i<n-t;i++)
		printf("%c",*(str+i));
}


int main()
{
	int i,m,n;
	char str[100],string[100]={""};
	gets(str);
	n=strlen(str);
	for(i=0;str[i]!='\0',i<n-1;i++)
	{
		if((str[i]==' ')&&(str[i+1]==' '))
	{
			for(m=i;m<n-1;m++)
     str[m]=str[m+1];
	n--;
	i=0;
	}
	}
	strncpy(string,str,n);
	printf("%s",string);
	return 0;
}


int main()
{
    char string[100];
    gets(string);
    int i,j;
    int num;
    int count=0;
    num=strlen(string);
    for(i=1;i<num;i++)
    {
                    if(string[i]==' '&&string[i-1]==' ')
                    {
                                    for(j=i;j<num;j++)
                                    {
                                    string[j]=string[j+1];
                                    }
                                    count++;
                                    string[num-count]='\0';
                                    i=i-1;
                    }

    }
    puts(string);
    return 0;
    }


char sen[256];
int len,i;
int del();
int main()
{
gets(sen);
len=strlen(sen);
for (i=0;i<len;i++)
{
if (sen[i]==32)
del();
}
for (i=0;i<len;i++)
{
	if (sen[i]!=126)
	printf("%c",sen[i]);
}
return 0;
}
int del()
{
	int j;
	for (j=i+1;j<len;j++)
	{
		if (sen[j]==32)
		sen[j]=126;
		else
		return 0;
	}
	return 0;
}


void main()
{
	char *p;
	int i,j,k,l;
	p=(char*)malloc(50*sizeof(char));
	gets(p);
	l=strlen(p);
	for(i=0;i<l;i++)
	{
		if(*(p+i)==' ')
		{
		  	printf("%c",*(p+i));
		   	for(k=i+1;k<l;k++)
            {
			   if(*(p+k)!=' ')  {i=k-1;break;}
            }
		}

 	    else printf("%c",*(p+i));

  	 }

    free(p);
}


int main()
{
	char a[1000];
	char *p[1000];
	int i;
	cin.getline(a,1000);
	for(i=0;i<strlen(a);i++)
	{
		if(a[i]!=' ')
		{
			p[i]=&a[i];
		}
		else
		{
			p[i]=NULL;
		}
	}
	for(i=0;i<strlen(a);i++)
	{
		if(p[i]!=NULL)
		{
			cout<<*p[i];
		}
		else if(p[i+1]!=NULL)
		{
			cout<<" ";
		}
		else
			continue;
	}
	return 0;
}


main()
{
    char str[210];
    int i,n;
    gets(str);
    printf("%c",str[0]);
    for(i=1,n=strlen(str);i<n;i++)
    {
        if(str[i]==' '&&str[i-1]==' ');
        else
            printf("%c",str[i]);
    }
    printf("\n");
    }


int main()
{
	char *p, a[100];
	int leap = 0;
	p = a;
	do
	{
		cin.get(*p);
		if (*p != ' ')
		{
			cout << *p;
			leap = 0;
		}
		if (*p == ' ' && leap == 0)
		{
			cout << *p;
			leap = 1;
		}
	}while (*p++ != '\n');
	cout << endl;
	return 0;
}


int main(){
       char s[205];
       char a[205];
       int i,m;
       gets(s);
       int len;
       i=0;
       len = strlen(s);
         for(int j = 0; j < len; j++)
        {
           if (s[j]!=' ')
             a[i]=s[j];
           else if((s[j]=' ')&&(s[j+1]!=' '))
             a[i]=s[j];
           else continue;
            i++;
         }
         printf("%s",a);
       return 0;
}


char str[100] = {0};
int flag = 0;
int len;
void clear (char *a)
{
	if(a == str)
	{
		cout << *a ;
		return;
	}
	else
		if(*a == 32 && flag != 0)
			clear (a - 1);
		else
			if (*a == 32)
			{
				flag ++;
				clear(a-1);
				cout << ' ';
			}
			else
			{
				flag = 0;
				clear (a-1);
				cout << *a;
			}
}

int main()
{
	cin.getline(str,100);
    len = strlen(str);
	clear (str+len-1);
	return 0;
}


/*
 * longwords.cpp
 *
 *  Created on: 2013-11-4
 *      Author: dyx
 */
int main()
{
	char words[100];
	cin.getline(words,100);

	int i,j=0;
	for(i=0;words[i]!='\0';i++)
	{
		if(words[i]==' ')
		{
			if(j==1)
				continue;
			if(j==0)
				j++;
		}
		if(words[i]!=' ')
			j=0;
		cout << words[i];
	}

}


int main()
{
	char str[200];
	gets(str);
	int len=strlen(str);
	int i,j,f=0;
	for(i=0;i<len-f;i++){
		if(str[i]==' '&&str[i+1]==' '){
			for(j=i;j<len-f;j++){
				str[j]=str[j+1];
				i=0;
			}
			str[len-f-1]='\0';
			f++;
		}
	}
	puts(str);
	return 0;
}


int main()
{
	int i;
	char zfc[MAX];

	gets(zfc);

	for(i=0;zfc[i];i++){
		if(zfc[i]!=' '){
			printf("%c",zfc[i]);
		}

		if(zfc[i]==' '&&zfc[i+1]!=' '){
			printf("%c",zfc[i]);
		}
	}
   return 0;
}


int main()
{

char str[100];
int i;
gets(str);
for(i=0;i<strlen(str);i++)
if(str[i]!=' ')
printf("%c",str[i]);
else if(str[i]==' ')
{if(str[i-1]!=' ')
printf("%c",str[i]);
}

return 0;
}


int main()
{
	int flag = 1;
	char *p, sentence[100];
	cin.getline(sentence, 100, '\n');
	for(p = sentence ; p <= sentence + strlen(sentence) - 1 ; p ++)
	{
		if(*p != ' ')
		{
			cout << *p;
			flag = 1;
		}
		else if(flag)
		{
			cout << ' ';
			flag = 0;
		}
	}
	return 0;
}


int main() {
	char array[1000], cur[1000];
	cin.getline(array, 1000);
	int len = strlen(array), step = 0;
	for (int i = 0; i < len; i++) {
		if (array[i] != ' ')
			cur[step++] = array[i];
		else {
			if (i != 0 && array[i - 1] != ' ' && array[i - 1] != '.')
				cur[step++] = array[i];
		}

	}
	for (int i = 0; i < step; i++)
		cout << cur[i];
	return 0;
}


int  main()
{
	char s[301];
	char *p=s;
	gets(s);
	cout<<*p;
	for(int i=1;i<strlen(s);i++)
	{
		if(p[i]==' '&&p[i-1]==' ')
		continue;
		else
		cout<<p[i];
	}
	//while(1);
	return 0;
}


int main()
{
	char a[100];
	int len,i,flag;
	gets(a);
	len=strlen(a);
	for(i=0;i<len;i++)
	{
		if(a[i]!=' '){printf("%c",a[i]);flag=1;}
		else if(flag){printf(" ");flag=0;}
	}
	printf("\n");
}


int main()
{
	char Sentence[501];
	char *pos = Sentence, *shift = NULL;
	cin.getline(Sentence, 501);

	for ( ; *pos != '\0'; pos++)
	{
		if (*pos != ' ')
			cout << *pos;
		else
		{
			cout << *pos;
			shift = pos + 1;
			for ( ; *shift == ' '; )
				shift++;
			pos = shift;
			cout << *pos;
		}
	}
	cout << endl;
	return 0;
}


main()
{
	char c,d;
	while((c=getchar())!='\n')
	{
		if(c!=' '||d!=' ') putchar(c);
	    d=c;
	}
	printf("\n");
	return 0;
}


int main()
{
	char *str,*p;
	int n,k,i;
	str=(char*)malloc(100*sizeof(char));
	gets(str);
	p=str;
	n=strlen(str);
	k=n;
	for(i=0;i<n;i++)
	{
		if(*(p+i)!=' ')
		{
			printf("%c",*(p+i));
		}
		if(*(p+i)==' '&&*(p+i+1)!=' ')
		{
			printf(" ");
		}
	}
	return 0;
}


void main()
{
	char str[10000];int i,sum=0,j;
	gets(str);
	for(i=0;i<strlen(str);i++)
	{
		if(str[i]==' '&&str[i-1]==' ')

		{
			sum++;
			for(j=i;j<strlen(str);j++)
				*(str+j)=*(str+j+1);
			i--;
		}
	}
	for(i=0;i<strlen(str);i++)
		printf("%c",str[i]);

}


/*
 *???: filter_spaces.cpp
 *??: ???
 *????: 2012-12-09
 *??:
 */

int main()
{
	char input[MAXL],output[MAXL];
	char *s,*t; //??input,output???
	cin.getline(input,sizeof(input));
	for (s=input,t=output; *s; s++){
		if (*s==' '&&*(s-1)==' ')
			continue;
		*t++=*s;
	}
	*t=0; //????\0
	cout << output << endl;
	return 0;
}


/*
 * shuzu2.12.cpp
 *
 *  Created on: 2013-11-12
 *      Author: st
 */
int main()
{
	char a[100];
	cin.getline(a,100);
	int i,k,spcamount=0;

	for(i=0;i<strlen(a);i++)
	   if((a[i]==' ')&&(a[i+1]!=' '))
		   continue;
	   else
		   if((a[i]==' ')&&(a[i+1]==' '))
			   {spcamount++;
			   for(k=i;k<strlen(a)-spcamount;k++)
                a[k]=a[k+1];
			    i--;
			   }

   for(i=0;i<strlen(a)-spcamount;i++)
        cout<<a[i];
	return 0;

}


int main()
{
	char a,b;
	cin>>a;
	cout<<a;
	while((b=getchar())&&(b!='\n'))
	{
		if(b!=' ')
			cout<<b;
		if(b==' '&&a!=' ')
			cout<<b;

		a=b;
	}
	return 0;
}


int main()
{
	char a[201];
	cin.getline(a,201);
	int len,f=0;
	len=strlen(a);
	for(int i=0;i<len;i++)
	{
		if(a[i]!=' ')
		{
			f=1;
			cout<<a[i];
		}else
		{
			if(f==1)
			{
				cout<<' ';
				f=0;
			}
		}
	}
	return 0;
}


int main(){
    int c,space=0;
    while(1){
        c = getchar();
        if(c == '\n'){break;}
        if(c == 32 && space == 0){
            putchar(c);
            space = 1;
        }
        else if(c != 32){
            putchar(c);
            space = 0;
        }
    }
    return 0;
}


int main()
{
	int i, flag = 0;
	char *p = NULL;
	char sentence[200];
	cin.getline(sentence,200);
	p = sentence;
	for (i = 0; sentence[i] != '\0'; i++)
	{
		if (sentence[i] != ' ')
		{
			*p = sentence[i];
			p++;
			flag = 1;
			continue;
		}
		if (sentence[i] == ' ' && flag == 1)
		{
			*p = sentence[i];
			p++;
			flag = 0;
		}
	}
	*p = '\0';
    cout << sentence;
	return 0;
}


int main(){
char ch[101];
	gets(ch);
	for (int i = 0;i<strlen(ch)-1;i++){
		if(ch[i]==' '&&ch[i+1]==' '){
			for (int j = i;j<strlen(ch);j++){
				ch[j]=ch[j+1];

			}
			i=i-1;
			}
		}
	cout<<ch<<endl;
	return 0;
}


int main()
{
	char str[1000];
	for(int i = 0; cin >> str; i++)
	{
		if(i == 0)
			cout << str;
		else
			cout << " " << str;
	}
	cout << endl;

	return 0;
}


int main(){
    int n,a;
    char zfc[201];
    gets(zfc);
    n=strlen(zfc);
    for(int i=0;i<n;i++){
        if(zfc[i]==' '){
            a=0;
            for(int k=i+1;k<n;k++){
                if(zfc[k]==' '){
                    a++;
                }
                else{
                    break;
                }
            }
            for(int k=i+a+1;k<n;k++){
                zfc[k-a]=zfc[k];
            }
            n-=a;
        }
    }
    for(int i=0;i<n;i++){
        printf("%c",zfc[i]);
    }
    return 0;
}


int main()
{
	char x[101];
	cin.getline(x,	101);
	int i,	n1,	j;
	n1	=	strlen(x);
	for(i	=	0;	i	<	n1;	i++)
	{
		if(x[i]	==	' ')
		{
			int count	=	0;
			for(j	=	i	+	1;	j	<	n1;	j++)
			{
				if(x[j]	==	' ')
				{
					count++;
				}
				else
				{
					break;
				}
			}
		    strcpy(x	+	i,	x	+	i	+	count);
			n1	=	n1	-	count;
		}
	}
	cout	<<	x	<<	endl;
	return 0;
}


int main()
{  char string[100];
	int i;
	char c;
	gets(string);
   for(i=0;c=string[i]!='\0';i++)
   if(c=string[i]!=' ')
   printf("%c",string[i]);
   else
   if(c=string[i-1]!=' ')
   printf("%c",string[i]);
   else continue;
   printf("%c",'\n');
	return 0;
}


int main()
{
    char string[100];
    gets(string);
    int i,j;
    int num;
    int count=0;
    num=strlen(string);
    for(i=1;i<num;i++)
    {
                    if(string[i]==' '&&string[i-1]==' ')
                    {
                                    for(j=i;j<num;j++)
                                    {
                                    string[j]=string[j+1];
                                    }
                                    count++;
                                    string[num-count]='\0';
                                    i=i-1;
                    }

    }
    puts(string);
    getchar();
    getchar();
    return 0;
    }


int main()
{
	char str[1000];
	int i,j,flag=1;
	cin.getline(str,1000);
	int len=strlen(str);
	for(i=0;i<len;i++)
	{
		if(flag==0&&str[i]!=' ')cout<<' ';
		if(str[i]==' ')flag=0;
		else {flag=1;cout<<str[i];}
	}
	return 0;
}


int main()
{
	char chsentence[100000];
	char chnew[100000];
	int i, j, nlen;
	memset(chsentence, 0, sizeof(chsentence));
	memset(chnew, 0, sizeof(chnew));
	cin.getline(chsentence, 100000);
	for (i = 0, j = 0; chsentence[i] != '\0'; i++)
	{
		if(chsentence[i] != ' ')
		{
			chnew[j] = chsentence[i];
			j++;
		}
		else if (chsentence[i] == ' ')
		{
			if (chsentence[i - 1] == ' ')
				continue;
			else
			{
				chnew[j] = chsentence[i];
				j++;
			}
		}

	}
	nlen = strlen(chnew);
	for (i = 0; i < nlen; i++)
		cout << chnew[i];
	return 0;
}


int main()
{
	char str[1000];
	int len,sum=0;
	cin.getline(str,999,'\n');
	len=strlen(str)-1;
	int i=0;
	while(i<=len-1)
	{
		if(str[i]==' '&&str[i+1]==' ')
		{
			for(int j=i;j<=len-1;j++)
				str[j]=str[j+1];
			sum=sum+1;
			i=i-1;
		}
		i=i+1;
	}
	for(int i=0;i<=len-sum;i++)
		cout<<str[i];
	return 0;
}


int main(int argc, const char * argv[]){
    char line[250];
    cin.getline(line, 210, '\n');
    char * p_1=line;
    for (int i=0; i<strlen(line); i++) {
        if (* (p_1+i)==' ') {
            if (* (p_1+i+1)!=' ') {
                cout<<* (p_1+i);
            }
        }
        else cout<<* (p_1+i);
    }
    return 0;

}


int main()
{
	char a[201];
	char *p = NULL;
	gets(a);
	p = a;
	int n = strlen(a);
	//cout << n << endl;
	int num = 0;
	for(p = a; p < a+n; p++)
	{
		if( *p == ' ' )
			num ++;
	    if( *p != ' ' && *(p-1) == ' ' )
			num = 0;
		if( num  == 0 || num == 1 )
			cout << *p;
	}
	return 0;
}


int main()
{
	int a, b[101] = { 0 };
	char str[101];
	char *p=NULL;
	int *q=NULL;
	cin.getline(str,101);
	a=strlen(str);
	for(q=b,p=str;p<str+a;p++,q++)
	{
		if(*p==' '&&*(p+1)==' ')
		{
			*q=1;
		}
	}
	for(q=b,p=str;p<str+a;p++,q++)
	{
		if(*q!=1)cout<<*p;
	}

	return 0;
}


void main()
{char a=' ',b=' ';
 int i;
for (i=1;i<100;i++)
 {a=b;
  scanf("%c", &b);
  if (b==' '&&a==' ')
	  continue;
  else printf("%c", b);
  if (b=='.')
	  break;
 }
}


int main()
{
	char *str,*p,*start;
	str=(char *)calloc(1000,sizeof(char));
	for (p=str;*(p-1)!='\n';p++)
		scanf("%c",p);
	int countspace=0;
	start=str;

	for (p=str;*p!='\n';p++)
		if (*p==' ')
		{
			if (*(p-1)!=' ') start=p;
			countspace++;
			if (*(p+1)!=' ')
			{
				if (countspace>1)
					for (p=start+1;*(p-1)!='\n';p++)
						*p=*(p+countspace-1);
				countspace=0;
				p=start+1;
			}
		}
	for(p=str;*(p-1)!='\n';p++)
		printf("%c",*p);
	return 0;
}


int main(){
	char s[101],modified[101];
	int i,j;
	gets(s);
	j=0;
	for(i=0;i<strlen(s)-1;i++){
		if(s[i]!=' '||(s[i]==' '&&s[i+1]!=' ')){
			modified[j]=s[i];
			j++;
		}
	}
	if(s[strlen(s)-1]!=' '){
		modified[j]=s[strlen(s)-1];
		modified[j+1]=0;
	}else
		modified[j]=0;
	printf("%s\n",modified);
	return 0;
}


int main()
{
	char sentence[100], *p;
	cin.getline(sentence, 100);
	p = sentence;
	int len = strlen(sentence), i = 0;
	while(i < len)
	{
		if(*p != ' ')
		{
			cout << *p++;
			i++;
		}
		else
		{
			cout << ' ';
			p++;
			i++;
			while(*p == ' ')
			{
				p++;
				i++;
			}
		}
	}

return 0;
}


main()
{
	char a[3000],i;
	gets(a);
	for(i=0;i<(signed)strlen(a);i++)
	{
		printf("%c",a[i]);
		if(a[i]==' ')
		{
		for(;i<(signed)strlen(a);i++)
		{
			if(a[i+1]!=' ')
				break;
		}}
	}

}


int main()
{
	char sentence[1000][20];
	int i = 0, i0;
	while(cin >> sentence[i])
	{
			i++;
	}
	i0 = i - 1;
	for (i = 0; i < i0; i++)
	{
		cout << sentence[i] << " ";
	}
	cout << sentence[i];

return 0;
}


int main(){
    char zfc[10005];
	gets(zfc);
	int i,l;
	l=strlen(zfc);
	for(i=0;i<l;i++){
		if(zfc[i]!=' '||(zfc[i]==' '&&zfc[i-1]!=' ')){
			printf("%c",zfc[i]);
		}
	}
	return 0;
}


int main()
{
	char d;
    while((d=getchar())!=EOF)
	{
		printf("%c",d);
		if(d==' ')
		{
			for(;;)
			{
				if((d=getchar())==' ')continue;
				else
				{
                    printf("%c",d);
					break;
				}
			}
		}
	}
	return 0;
}


int main()
{
	char a[200];
	gets(a);
    int len;
	len=strlen(a);
	for(int i=0;i<len;i++)
	{
		if(a[i]!=' ')printf("%c", a[i]);
		else if(a[i]==' ' && a[i+1]!=' ') printf(" ");
	}
	 return 0;
}


int main(){
	char str[101][101];
	int n=1;
	char (*p)[101]=NULL;
	while(cin>>str[n])n++;
	for(p=str+1;p<str+n-1;p++){
		cout<<*p<<" ";
	}
	cout<<*p;
	return 0;
}


int main()
{
	char c;
	int f=1;
	while ((c=getchar())!=EOF)
	{
		if (c!=' ')
		{
			cout<<c;
			f=1;
		}//deal with words

		else if (f) {
			cout<<c;
			f=0;
		}//deal with space
	}
	return 0;
}


int main()
{
 	char zfc[1000],s[1000];
 	int length,i,num=0;
 	gets(zfc);
 	length=strlen(zfc);
 	for(i=0;i<length;i++){
		if(i==0){
			s[num]=zfc[i];
			num++;
			}
		else{
			if(zfc[i]!=' '||(zfc[i]==' '&&zfc[i-1]!=' '))
			{
				s[num]=zfc[i];
				num++;
				}
			}
		}
	for(i=0;i<num;i++){
		printf("%c",s[i]);
		}
    return 0;
}


int main(){
	int i,a;
	char z[300];
	gets(z);
	a=strlen(z);
    for(i=0;i<a;i++){

		if(z[i]!=' '){
			printf("%c",z[i]);
			continue;
		}
		if(z[i]==' '&&z[i+1]!=' '){
			printf("%c",z[i]);
			continue;
		}
	}
    return 0;
}


int main()
{
	char sentence[100] ;
	int i ,len,flag[100]={0};
	cin.getline(sentence,100);
	len=strlen(sentence);
	for(i=0;i<len;i++)
		if (sentence[i]==' '&&sentence[i+1]==' ') flag[i+1]=1;
	for(i=0;i<len;i++)
		if(flag[i]==0) cout<<sentence[i];
	return 0 ;
}


int main()
{
	char a[201];
	cin.getline(a,201);
	int n=strlen(a);

	char *p=a;
	int i=1;
	while(i<=n)
	{
		if(*p!=' ')
		{
		cout<<*p;
		p++;
		i++;
		}
		else
		{
			cout<<' ';
			while(*p==' ')
			{
				p++;
				i++;
			}
		}
	}

	return 0;
}


int main()
{
    char a[50];
    int flag = 1;
    cin.getline(a, 50);
    char *p = a;
    for (p = a; *p != '\0'; p++)
    {
        if (flag)
            cout << *p;
        if (*p == ' ' )
            flag = 0;
        if (*(p +1) != ' ' )
                flag = 1;
    }
    cout << endl;
    return 0;
}


int main()
{

	char s[100], *p;
	int i, l;
	p = s;
	cin.getline(s, 100);
	l = strlen(s);
	int sum = l;
	for (i = 0;i < l;i++)
	{
		if (p[i] == ' ')
		{
			if (p[i - 1] == ' ')
			{
				int k = i;
				while (p[i] == ' ')
					i++;
				for (int j = k;j < l - (i - k);j++)
					p[j] = p[j + i - k];
				if (i <= sum)
					sum = sum - (i - k );
				i = k ;
			}
		}
	}
	for (i = 0;i < sum;i++)
		cout << p[i];

	return 0;
}


int main(int argc, char* argv[])
{
   char str[250];
   int i,j,n;
   gets(str);
   for(i=0;i<strlen(str);i++)
   {
	 if(str[i]!=' ')  printf("%c",str[i]);
	 if(str[i]==' '&&str[i+1]!=' ')  printf(" ");
   }

	return 0;
}


int main(){
    char sen[MAX][MAX]={0};
	int i,e;
    for(i=0;i<MAX;i++){
		scanf("%s",sen[i]);
	}
	for(i=0;i<MAX;i++){
		if(sen[i][0]==0){
			e=i;
			break;
		}
	}
	printf("%s",sen[0]);
	for(i=1;i<e;i++){
		printf(" %s",sen[i]);
	}
	return 0;
}


int main(){
  char s[1100];
  int i,j;
  for (i=0;scanf("%s",s)!=EOF;i++)
    printf("%s%s",i==0?"":" ",s);
  printf("\n");
  return 0;
}


int main()
{
	char s[300];
	gets(s);
	int i, l;
	int flag = 1;
	l = strlen(s);
	for (i = 0; i < l; i++)
	{
		if (s[i] != ' ')
		{
			printf("%c", s[i]);
			flag = 1;
		}
		else if (s[i] == ' ')
		{
			if (flag == 0)
				continue;
			else
			{
				printf("%c", s[i]);
				flag = 0;
			}
		}
	}
	putchar('\n');
	return 0;
}


char a[100];
int i;
void sf()
{
     int l = strlen(a);
     char *p = a;
     for(p = a, i = 0; i < l; p++, i++)
     {
             if(*p!=' '||(a[i]==' '&& *(p + 1)!=' '))
             {
                 cout << a[i] ;
             }
     }
     return ;
}
int main()
{
    cin.getline(a,100);
    sf();
    cin >> a;
    return 0;
}


int main()
{
	char zifu[300],tihuan[300];
	int k,i=0;
	gets(zifu);
	for(k=0;k<strlen(zifu);k++)
	{
		if((zifu[k]!=' ')||(zifu[k]==' '&&zifu[k+1]!=' '))
		{
		   tihuan[i]=zifu[k];
		   i++;
		}
        else
		{
		   continue;
		}
	}
	for(k=0;k<i;k++)
	{
	printf("%c",tihuan[k]);
    }
	return 0;
}


int main()
{
   char ch[200],s[200];
   int m,i,j=0,word=0;
   gets(ch);
   m=strlen(ch);
   for(i=0;i<m;i++)
   {
      if(ch[i]!=' ')
      {
         s[j]=ch[i];
         j++;
         word=1;
      }
     else if(word==1)
      {
          word=0;
          s[j]=ch[i];
          j++;
      }
   }
   puts(s);
   return 0;
}


int main()
{
	int i = 0;
	char c[100];
	char *p;
	cin.getline(c,100);
	cout << c[0];
	for(p = c + 1; *p != '\0'; p++)
	{
		if(*p == ' ' && *(p - 1) == ' ')
			continue;
		cout << *p;
	}
	cout << endl;
	return 0;
}


int main()
{
	char str[100];
	cin.getline(str, 100);
	char * p = str;
	int i, j;
	int count = 0;
	for (i = 0; *(p + i) != '\0'; i ++)
	{

		if(*(p+i) == ' ')
			count ++;
		if (count == 1 && *(p+i) != ' ')
		 count = 0;
		if( count >= 2 && *(str+i) != ' ')
		{
			for (j = i - count + 1; *(p+j) != '\0'; j ++)
			 *(p+j) = *(p+j + count - 1);
			i -= count;
			count = 0;
		}

	}
	for (p = str; p < str +strlen(str); p ++)
	cout << *p;
	cout << endl;
	return 0;
}


int main()
{
	char a[200];
	cin.getline(a,199);
	int length=strlen(a),i=0;
	for(i=0;i<length;i++)
	{
		if(i>0)
		{
			if(a[i]==32&&a[i-1]==32)
				continue;
			else
				cout <<a[i];
		}
		else
			cout <<a[i];
	}
	cout <<endl;
	return 0;
}


int main()
{
	char str[200];
	char *pointer=NULL;
	cin.getline(str,200);
	pointer=str;
	while(*pointer!='\0')
	{
		if(*pointer!=' ')
			{
				cout<<*pointer;
				pointer++;
		}
		else
		{
			while(*(pointer+1)==' ')

					pointer++;
			pointer++;
			cout<<' ';
		}
	}
	return 0;
}


int main(void)
{
    char c;
    int k=-1;
    while(scanf("%c", &c)!=EOF)
    {
        if(!isspace(c))
            k=-1;
            else
            k++;
        if(isspace(c)&&k!=0)
            continue;
        printf("%c", c);
    }
    return 0;
}


int main()
{
     int i=0;
	 char c;

	 while((c=getchar())!='\n')
	 {
	 if(c!=' '){
		 cout<<c;
	     i=0;
		 continue;}

	 while(c==' ')
	 {
	     i=i+1;
		 if(i>=2)break;
		 cout<<c;
	 }
	 }
	 	 return 0;}


int main(){
    char str[50];
	cin>>str;
	cout<<str;
	for(;cin.get()!='\n';)
	{
		cin>>str;
		cout<<" "<<str;
		memset(str,'\0',sizeof(str));
	}
	cout<<endl;
	return 0;
}


int main(){
	char m[10000];
	char *pointer;
	int len,i,flag=0,j;
	cin.getline(m,10000);
	pointer=&m[0];
	len=strlen(m);
	for(i=0;i<len;i++){
		if(*pointer==' '&&flag==0){
			flag=1;
			pointer++;
		}
		else if(*pointer==' '&&flag==1){
			for(j=i;j<len-1;j++)
				m[j]=m[j+1];
			m[len-1]='\0';
			len--;
			i--;
		}
		else{
			flag=0;
			pointer++;
		}
	}
	cout<<m;
	return 0;
}


int main(int argc, char* argv[])
{
	int n,p,i,l;
	char a[200];

	gets (a);
	l=strlen(a);
	p=0;

	for (i=0;i<=l-1;i++)
	{
    	if (a[i]==' '&&(p==0))
		{
			printf(" ");
			p=1;

		}
        else if (a[i]==' '&&(p==1))
		{
			continue;
		}
		else
		{
			printf("%c",a[i]);
			p=0;
			continue;
		}

	}

	return 0;
}


int main(){
    int i,j=0,len,a;
    char jz[LEN],hjz[LEN];
    gets(jz);
    hjz[0]=jz[0];
    j++;
    for(i=1;i<LEN;i++){
        if(jz[i]==' '&&jz[i-1]==' '){continue;} else {
            hjz[j]=jz[i];
            j++;
        }
    }
    printf("%s",hjz);
    return 0;
}


int main()
{
    char *p;
    int i;
    p=(char *)malloc(1000*sizeof(char));
    scanf("%c",p);
    for (i=0;scanf("%c",p+i+1)!=EOF;i++)
    {
        if (isspace(*(p+i))==0)
        printf("%c",*(p+i));
        if (isspace(*(p+i))&&isspace(*(p+i+1))==0)
        printf(" ");
    }

    return 0;
}


main()
{
      int m,q,n;

      //input matrix a
      scanf("%d %d",&m,&q);

      int **a;
      a=(int **)malloc(m*sizeof(int *));
      for (int i=0;i<m;i++)
      a[i]=(int *)malloc(q*sizeof(int));

      for (int i=0;i<m;i++)
      for (int j=0;j<q;j++)
      scanf("%d",&a[i][j]);

      //input matrix b
      scanf("%d %d",&q,&n);

      int **b;
      b=(int **)malloc(q*sizeof(int *));
      for (int i=0;i<q;i++)
      b[i]=(int *)malloc(n*sizeof(int));

      for (int i=0;i<q;i++)
      for (int j=0;j<n;j++)
      scanf("%d",&b[i][j]);

      //deifne matrix c
      int **c;
      c=(int **)malloc(m*sizeof(int *));
      for (int i=0;i<m;i++)
      c[i]=(int *)malloc(n*sizeof(int));

      //start multimatrix
      /*for (int i=0;i<m;i++)
      for (int j=0;j<n;j++)
      {
          int s=0;
          for (int w=0;w<q;w++)
          s=s+a[i][w]*b[w][j];
          c[i][j]=s;
      }
      */
      for(int i=0;i<m;i++)
         for(int j=0;j<n;j++)
            for(int k=0;k<q;k++) c[i][j]=c[i][j]+a[i][k]*b[k][j];
      //output
      /*for (int i=0;i<m;i++)
      for (int j=0;j<n;j++)
      {
          if (j==0)
          printf("%d",c[i][j]);
          else if (j==n-1)
          printf(" %d\n",c[i][j]);
          else
          printf(" %d",c[i][j]);
      }
      */
      int i,j;
      for(i=0;i<m;i++)
      {
         for(j=0;j<n-1;j++) printf("%d ",c[i][j]);
         printf("%d\n",c[i][j]);
      }

}


int main()
{
	int matrix1[100][100], matrix2[100][100];
	int row1, column1, row2, column2, i, j, k, sum;
	scanf("%d%d", &row1, &column1);
	for(i=0; i<row1; i++)
		for(j=0; j<column1; j++)
			scanf("%d", &matrix1[i][j]);
	scanf("%d%d", &row2, &column2);
	for(i=0; i<row2; i++)
		for(j=0; j<column2; j++)
			scanf("%d", &matrix2[i][j]);
	int temp1 = column2-1;
	for(i=0; i<row1; i++)
	{
		for(j=0; j<temp1; j++)
		{
			sum = 0;
			for(k=0; k<column1; k++)
				sum += matrix1[i][k]*matrix2[k][j];
			printf("%d ", sum);
		}
		sum = 0;
		for(k=0; k<column1; k++)
			sum += matrix1[i][k]*matrix2[k][j];
		printf("%d\n", sum);
	}
	return 0;
}


int main(){
	int xa,ya,xb,yb;
	cin>>xa>>ya;
	int a[xa][ya];
	for(int i=0;i<xa;i++){
		for(int j=0;j<ya;j++){
			cin>>a[i][j];
		}
	}
	cin>>xb>>yb;
	int b[xb][yb];
	for(int i=0;i<xb;i++){
		for(int j=0;j<yb;j++){
			cin>>b[i][j];
		}
	}

	int c[xa][yb];
	for(int i=0;i<xa;i++){
		for(int j=0;j<yb;j++){
			c[i][j]=0;
			for(int k=0;k<xb;k++){
				c[i][j]=a[i][k]*b[k][j]+c[i][j];
			}
		}
	}

	for(int i=0;i<xa;i++){
		cout<<c[i][0];
		for(int j=1;j<yb;j++){
			cout<<" "<<c[i][j];
		}
		cout<<endl;
	}
}


// b[j][k] * c[k][i] = a[j][i]
void matrix(int **b,int **c, int **a, int nx, int ny, int nk)
{
int i,j,k;
for (j=0;j<ny;j++)for(i=0;i<nx;i++)a[j][i]= 0;
for(j=0;j<ny;j++){
for(i=0;i<nx;i++){
for(k=0;k<nk;k++)a[j][i]+= b[j][k]*c[k][i];
};
};
}

main()
{
int i,j,k,tmp;
int b_row,b_col;
int c_row,c_col;
int a_row,a_col;
int **b,**c,**a;

// ??B ? ?? ??

scanf("%d %d",&b_row,&b_col);
c_row = b_col;

b  = (int **) malloc(sizeof(int *) * b_row);
for (j=0;j<b_row;j++){
b[j] = (int *) malloc(sizeof(int) * b_col);
}

// ??B???

for (j=0;j<b_row;j++)
for (i=0;i<b_col;i++){
scanf("%d",&tmp);
b[j][i] = tmp;
}
// ??C? ??

scanf("%d %d",&c_row,&c_col);
a_row = b_row;
a_col = c_col;
c  = (int **) malloc(sizeof(int *) * c_row);
for (j=0;j<c_row;j++){
c[j] = (int *) malloc(sizeof(int) * c_col);
}
// ??C???

for (j=0;j<c_row;j++)
for (i=0;i<c_col;i++){
scanf("%d",&tmp);
c[j][i] = tmp;
}

a  = (int **) malloc(sizeof(int *) * a_row);
for (j=0;j<a_row;j++){
a[j] = (int *) malloc(sizeof(int) * a_col);
}
if (!c[c_row-1]) {
printf("no enought memory\n");exit(0);
}

matrix( b ,c,a, a_col, a_row, b_col);

for(j=0;j<a_row;j++)
{
for (i=0;i<a_col;i++)
  {if(i!=a_col-1)
  printf("%d ",a[j][i]);
    else
    printf("%d",a[j][i]);
  }
printf("\n");
};

}


int main()
{
	int a[100][100], b[100][100], c[100][100] = {0}, i, j, k;
	int arow, acol, brow, bcol;
	cin >> arow >> acol;
	for (i = 0; i < arow * acol; i++)
		cin >> a[i / acol][i % acol];
	cin >> brow >> bcol;
	for (i = 0; i < brow * bcol; i++)
		cin >> b[i / bcol][i % bcol];
	for (i = 0; i < arow; i++)
	{
		for (j = 0; j < bcol; j++)
		{
			for (k = 0; k < acol; k++)
				c[i][j] += a[i][k] * b[k][j];
			cout << c[i][j];
			if (j == bcol - 1)
				cout << endl;
			else
				cout << " ";
		}
	}
	return 0;
}


int g_arrayA[1024][1024];
int g_arrayB[1024][1024];

int main()
{
    int m, n, n1, k;
    cin >> m >> n;
    for (int i = 0; i < m; ++i)
    {
        for (int j = 0; j < n; ++j)
            cin >> g_arrayA[i][j];
    }
    cin >> n1 >> k;
    for (int i = 0; i < n1; ++i)
    {
        for (int j = 0; j < k; ++j)
            cin >> g_arrayB[i][j];
    }
    for (int i = 0; i < m; ++i)
    {
        for (int j = 0; j < k; ++j)
        {
            int result = 0;
            for (int t = 0; t < n; ++t)
                result += g_arrayA[i][t] * g_arrayB[t][j];
            if (j == 0)
                cout << result;
            else
                cout << " " << result;
        }
        cout << endl;
    }
}


    int ilong1,ilong2,iwide1,iwide2,buffer;
    int mat1[100][100],mat2[100][100],mat3[100][100];

int main()
{

    cin >> ilong1 >> iwide1;

    for(int i = 0; i < ilong1; i++){
        for(int j = 0; j < iwide1; j++){
            cin >> mat1[j][i];
        }
    }

    cin >> ilong2 >> iwide2;

    for(int i = 0; i < ilong2; i++){
        for(int j = 0; j < iwide2; j++){
            cin >> mat2[j][i];
            //cout << mat2[j][i];
        }
    }

    for(int i = 0; i < ilong1; i++){
        for(int j = 0; j < iwide2; j++){
            buffer = 0;
            for(int k = 0; k < iwide1; k++){
                buffer = buffer + mat1[k][i]*mat2[j][k];
            }
            mat3[i][j] = buffer;
        }
    }

    for(int i = 0; i < ilong1 - 1; i++){
        for(int j = 0; j < iwide2 - 1; j++){
            cout << mat3[i][j] << ' ';
        }
        cout << mat3[i][iwide2 - 1] << endl;
    }
    for(int j = 0; j < iwide2 - 1; j++){
        cout << mat3[ilong1 - 1][j] << ' ';
        }
        cout << mat3[ilong1 - 1][iwide2 - 1];
    return 0;
}


main()
{
      int x1,y1,x2,y2;
      int i,j,k;
      int sum;
      scanf("%d %d",&x1,&y1);
      int*a=(int*)malloc(x1*y1*sizeof(int));
      for(i=0;i<x1;i++)
      {
            for(j=0;j<y1;j++)
            scanf("%d",&a[i*y1+j]);
      }
      scanf("%d %d",&x2,&y2);
      int*b=(int*)malloc(x2*y2*sizeof(int));
      int*c=(int*)malloc(x1*y2*sizeof(int));
      for(i=0;i<x2;i++)
      {
           for(j=0;j<y2;j++)
           scanf("%d",&b[i*y2+j]);
      }
      for(i=0;i<x1;i++)
      {
                       for(j=0;j<y2;j++)
                       {
                                        sum=0;
                                        for(k=0;k<x2;k++)
                                        sum=sum+a[i*y1+k]*b[k*y2+j];
                                        c[i*y2+j]=sum;
                                        printf("%d",c[i*y2+j]);
                                        if((j+1)%y2!=0)
                                        printf(" ");
                                        else
                                        printf("\n");
                       }
      }
      free(a);
      free(b);
      free(c);
      getchar();
      getchar();
}


int main()
{
    int x1,y1;
    int x2,y2;
    int i=0,j=0;
    scanf("%d %d",&x1,&y1);
    int **aa;
    aa=(int **)malloc(sizeof (int *)*x1);
    for(i=0;i<x1;i++)
    {
        aa[i]=(int *)malloc(sizeof(int)*y1);
        for(j=0;j<y1;j++)
        scanf("%d",&aa[i][j]);
    }
    scanf("%d %d",&x2,&y2);
    int **bb;
    bb=(int **)malloc(sizeof (int *)*x2);
    for(i=0;i<x2;i++)
    {
        bb[i]=(int *)malloc(sizeof(int)*y2);
        for(j=0;j<y2;j++)
        scanf("%d",&bb[i][j]);
    }
    int **cc;
    cc=(int **)malloc(sizeof (int *)*x1);
    for(i=0;i<x1;i++)
    {
        cc[i]=(int *)malloc(sizeof(int)*y2);
        for(j=0;j<y2;j++)
            cc[i][j]=0;
        for(j=0;j<y2;j++)
            for(int p=0;p<x2;p++)
                cc[i][j]+=aa[i][p]*bb[p][j];
    }
    for(i=0;i<x1;i++)
    {
        for(j=0;j<y2-1;j++)
            printf("%d ",cc[i][j]);
        printf("%d\n",cc[i][j]);
    }
    return 0;
}


struct distance
{
       double length;
       int start;
       int end;
};
main()
{
      int n;
      scanf("%d",&n);
      int point[10][4];
      int i,j;
      struct distance dist[45];
      for (i=0;i<n;i++)
      scanf("%d %d %d",&point[i][1],&point[i][2],&point[i][3]);
      int k=0;
      for (i=0;i<n-1;i++)
        for (j=i+1;j<n;j++)
        {
            dist[k].length=sqrt((point[i][1]-point[j][1])*(point[i][1]-point[j][1])+(point[i][2]-point[j][2])*(point[i][2]-point[j][2])+(point[i][3]-point[j][3])*(point[i][3]-point[j][3]));
            dist[k].start=i;
            dist[k].end=j;
            k++;
        }
      double temp;
      int temp1;
      for (i=0;i<k-1;i++)
         for (j=0;j<k-1-i;j++)
         if (dist[j].length<dist[j+1].length)
         {
             temp=dist[j].length;
             dist[j].length=dist[j+1].length;
             dist[j+1].length=temp;
             temp1=dist[j].start;
             dist[j].start=dist[j+1].start;
             dist[j+1].start=temp1;
             temp1=dist[j].end;
             dist[j].end=dist[j+1].end;
             dist[j+1].end=temp1;
         }
      for (i=0;i<k;i++)
      {
          printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",point[dist[i].start][1],point[dist[i].start][2],point[dist[i].start][3],point[dist[i].end][1],point[dist[i].end][2],point[dist[i].end][3],dist[i].length);
      }
      getchar();getchar();
}


int main(){

int n,i,j,k=0,Nline,dx,dy,dz;
scanf("%d",&n);     //??????

struct Dot{
int x,y,z;
} dots[n];          //????,????????

Nline=n*(n-1)/2;      //??????(????????)

for(i=0;i<n;i++)
{
    scanf("%d %d %d",&dots[i].x,&dots[i].y,&dots[i].z);    //??????
}

struct Line{
int x1,y1,z1;
int x2,y2,z2;
float dist;
} lines[Nline],temp;        //???????????-???????????

for(i=0;i<n;i++){           //??????
    for(j=(i+1);j<n;j++)
    {
        lines[k].x1=dots[i].x;
        lines[k].y1=dots[i].y;
        lines[k].z1=dots[i].z;
        lines[k].x2=dots[j].x;
        lines[k].y2=dots[j].y;
        lines[k].z2=dots[j].z;

        dx=lines[k].x1-lines[k].x2;
        dy=lines[k].y1-lines[k].y2;
        dz=lines[k].z1-lines[k].z2;
        lines[k].dist=sqrt(dx*dx+dy*dy+dz*dz);

        k++;
    }
}

for(i=0;i<Nline-1;i++)//??Nline?
{
    for(j=0;j<Nline-i;j++)
    {
        if(lines[j].dist<lines[j+1].dist)
        {
            temp=lines[j];
            lines[j]=lines[j+1];
            lines[j+1]=temp;
        }
    }
}

for(i=0;i<Nline;i++)
{
  printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n",lines[i].x1,lines[i].y1,lines[i].z1,lines[i].x2,lines[i].y2,lines[i].z2,lines[i].dist);
 // printf("%d",i);
}

return 0;
}


struct dot{
	int x;
	int y;
	int z;
}dots[10];
struct dist{
	int d1;
	int d2;
	float dis;
}dists[45];
int cmp(const void *p1,const void *p2)
{
	struct dist l1,l2;
	l1=*(struct dist *)p1;
	l2=*(struct dist *)p2;
	if(l1.dis>l2.dis)
	{
		return -1;
	}else if(l1.dis<l2.dis)
	{
		return 1;
	}else{
		if(l1.d1!=l2.d1)
		{
			return l1.d1-l2.d1;
		}else{
			return l1.d2-l2.d2;
		}
	}
	return 0;
}
int main()
{
	int n,i,j,t=0;
	scanf("%d",&n);
	for(i=0;i<n;i++)scanf("%d%d%d",&dots[i].x,&dots[i].y,&dots[i].z);
	for(i=0;i<n-1;i++)
	{
		for(j=i+1;j<n;j++)
		{
			dists[t].d1=i;
			dists[t].d2=j;
			dists[t].dis=sqrt((dots[i].x-dots[j].x)*(dots[i].x-dots[j].x)+(dots[i].y-dots[j].y)*(dots[i].y-dots[j].y)+(dots[i].z-dots[j].z)*(dots[i].z-dots[j].z));
			t++;
		}
	}
	qsort(&dists[0],t,sizeof(struct dist),cmp);
	for(i=0;i<t;i++)printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n",dots[dists[i].d1].x,dots[dists[i].d1].y,dots[dists[i].d1].z,dots[dists[i].d2].x,dots[dists[i].d2].y,dots[dists[i].d2].z,dists[i].dis);
	return 0;
}


int main()
{
	struct point
	{
		int x;
		int y;
		int z;
	}Point[10];
	int n,i,j,k=0,f[45],b[45],temp;
	double d[45],num;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d%d%d",&Point[i].x,&Point[i].y,&Point[i].z);
	}
	for(i=0;i<n;i++)
	{
		for(j=i+1;j<n;j++)
		{
			d[k]=sqrt((Point[i].x-Point[j].x)*(Point[i].x-Point[j].x)+(Point[i].y-Point[j].y)*(Point[i].y-Point[j].y)+(Point[i].z-Point[j].z)*(Point[i].z-Point[j].z));
			f[k]=i;
			b[k]=j;
			k=k+1;
		}

	}
	for(i=0;i<k;i++)
	{
		for(j=0;j<k-i;j++)
		{
			if(d[j]<d[j+1])
			{
				temp=f[j];
				f[j]=f[j+1];
				f[j+1]=temp;
				temp=b[j];
				b[j]=b[j+1];
				b[j+1]=temp;
				num=d[j];
				d[j]=d[j+1];
				d[j+1]=num;
			}
		}
	}
	for(i=0;i<k;i++)
	{
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",Point[f[i]].x,Point[f[i]].y,Point[f[i]].z,Point[b[i]].x,Point[b[i]].y,Point[b[i]].z,d[i]);
	}
	return 0;
}


int main(){
	struct dian{
		int x,y,z;
	}dians[45];
	struct suoyou{
		struct dian qian;
		struct dian hou;
		double ji;
	}suoyous[45],e;
	int n;
	scanf("%d",&n);
	int i;
	for(i=0;i<n;i++){
		scanf("%d%d%d",&dians[i].x,&dians[i].y,&dians[i].z);
	}
	int k,l=0;
	for(i=0;i<n;i++){
		for(k=i+1;k<n;k++){
			suoyous[l].qian=dians[i];
			suoyous[l].hou=dians[k];
			suoyous[l].ji=sqrt((dians[i].x-dians[k].x)*(dians[i].x-dians[k].x)+(dians[i].y-dians[k].y)*(dians[i].y-dians[k].y)+(dians[i].z-dians[k].z)*(dians[i].z-dians[k].z));
			l++;
		}
	}
	for(i=1;i<=n*(n-1)/2;i++){
		for(k=0;k<n*(n-1)/2-i;k++){
			if(suoyous[k].ji<suoyous[k+1].ji){
				e=suoyous[k];
				suoyous[k]=suoyous[k+1];
				suoyous[k+1]=e;
			}
		}
	}
	for(i=0;i<n*(n-1)/2;i++){
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",suoyous[i].qian.x,suoyous[i].qian.y,suoyous[i].qian.z,suoyous[i].hou.x,suoyous[i].hou.y,suoyous[i].hou.z,suoyous[i].ji);
	}
	return 0;
}


float f(int a,int b,int c,int d,int e,int f);
int main()
{
    int x[11],y[11],z[11],i,j,n,num=0;
    scanf("%d",&n);
    //scanf("%d %d %d",&x[0],&y[0],&z[0]);
    for(i=0;i<n;i++)
    scanf("%d %d %d",&x[i],&y[i],&z[i]);
    struct POINT
    {
          int point1x;
          int point1y;
          int point1z;
          int point2x;
          int point2y;
          int point2z;
		  int mark;
          float l;
    };
    struct POINT temp;
    struct POINT d[55];
    for(i=0;i<n;i++)
    {
                    for(j=i+1;j<n;j++)
                    {
                                      d[num].mark=num;
                                      d[num].point1x=x[i];d[num].point1y=y[i];d[num].point1z=z[i];
                                      d[num].point2x=x[j];d[num].point2y=y[j];d[num].point2z=z[j];
                                      d[num].l=f(x[i],y[i],z[i],x[j],y[j],z[j]);
                                      num=num+1;            //printf("%.2f\n",d[num].l);printf("%d %d %d %d %d %d\n",x[i],y[i],z[i],x[j],y[j],z[j]);
                    }
    }                         //for(i=num-1;i>=0;i--)printf("%.2f\n",d[i].l);//printf("%d\n",num);
    for(i=1;i<num;i++)
    {
                      for(j=0;j<num-i;j++)
                      {
                                        if(d[j].l>d[j+1].l)
                                        {
                                                           temp=d[j];
                                                           d[j]=d[j+1];
                                                           d[j+1]=temp;
                                        }
                      }
    }
	for(i=1;i<num;i++)
    {
                      for(j=0;j<num-i;j++)
                      {
                                        if(d[j].l==d[j+1].l&&d[j].mark<d[j+1].mark)
                                        {
                                                           temp=d[j];
                                                           d[j]=d[j+1];
                                                           d[j+1]=temp;
                                        }
                      }
    }                                                                                //printf("%.2f\n",d[3].l);
    for(i=num-1;i>=0;i--)
    printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n",d[i].point1x,d[i].point1y,d[i].point1z,d[i].point2x,d[i].point2y,d[i].point2z,d[i].l);

    return 0;
}
float f(int a,int b,int c,int d,int e,int f)
{
      float length;
      length=sqrt((a-d)*(a-d)+(b-e)*(b-e)+(c-f)*(c-f));
      return(length);
}


struct point1
{
  int x;
  int y;
  int z;
} point[10];

struct comb1
{
  struct point1 po1;
  struct point1 po2;
  double distant;
} comb[50],t;
int abs(int a)
{
  if(a>=0) return a;
  else return(-a);
}
double dis(struct point1 a,struct point1 b)
{
   int p,q,r;
   double ans;
   p=(a.x-b.x)*(a.x-b.x);
   q=(a.y-b.y)*(a.y-b.y);
   r=(a.z-b.z)*(a.z-b.z);
   ans=sqrt(p+q+r);
   return ans;
}

int main()
{
  int n,i,j,k;
  scanf("%d",&n);
  for(i=0;i<n;i++)
   scanf("%d%d%d",&point[i].x,&point[i].y,&point[i].z);
  k=0;
  for(i=0;i<n;i++)
   for(j=i+1;j<n;j++)
    {
	  comb[k].po1=point[i];
	  comb[k].po2=point[j];
	  comb[k].distant=dis(comb[k].po1,comb[k].po2);
	  k++;
	}
  for(i=1;i<k;i++)
   for(j=0;j<k-i;j++)
    if(comb[j].distant<comb[j+1].distant)
	{
	  t=comb[j];
	  comb[j]=comb[j+1];
	  comb[j+1]=t;
	}
  for(i=0;i<k;i++)
   printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",comb[i].po1.x,comb[i].po1.y,comb[i].po1.z,comb[i].po2.x,comb[i].po2.y,comb[i].po2.z,comb[i].distant);
  //scanf("%d",&i);
  return 0;
}


typedef struct point
{
	int x,y,z;
}Point;

double Distance(Point p1, Point p2)
{
	double dist=0;
	dist = sqrtf((p1.x-p2.x)*(p1.x-p2.x) + (p1.y-p2.y)*(p1.y-p2.y) + (p1.z-p2.z)*(p1.z-p2.z)+0.0 );
	return dist;
}
int main(int argc, char* argv[])
{
	int n, i, j, k=0, numtotal, maxpj=0, maxpi=0;
	double ** ppdDist,  dMaxDist=0.0;//*p1Dist,
	Point * pcPoint;

	scanf("%d",&n);
	numtotal = n*(n-1)/2;
	//p1Dist = (double *)calloc(numtotal, sizeof(double));
	ppdDist = (double**)calloc(n, sizeof(double*));
	for (i=0; i<n; i++)
	{
		ppdDist[i] = (double *)calloc(n, sizeof(double));
	}
	pcPoint = (Point *) calloc(n, sizeof(Point));

	for (j=0; j<n; j++)
	{
		for (i=0; i<n; i++)
		{
			ppdDist[j][i] = 0.0;
		}
	}
	//////////////////////////////////////////////////////////////////////////
	for (i=0; i<n; i++)
	{
		scanf("%d%d%d", &(pcPoint[i].x), &(pcPoint[i].y), &(pcPoint[i].z));
	}

	for (j=0; j<n; j++)
	{
		for (i=j+1; i<n; i++)
		{
			ppdDist[j][i] =Distance(pcPoint[j], pcPoint[i]);
		}
	}

	for (k=0; k<numtotal; k++)
	{
		for (j=0; j<n; j++)
		{
			for (i=j+1; i<n; i++)
			{
				if (ppdDist[j][i]>dMaxDist) ///????????????????0
				{
					maxpi = i;
					maxpj = j;
					dMaxDist = ppdDist[j][i];
				}
			}
		}
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n", pcPoint[maxpj].x, pcPoint[maxpj].y, pcPoint[maxpj].z,
			pcPoint[maxpi].x, pcPoint[maxpi].y, pcPoint[maxpi].z, dMaxDist);

		ppdDist[maxpj][maxpi] =0.0;// is out
		maxpi =0; maxpj =0; dMaxDist =0.0;

	}

	//////////////////////////////////////////////////////////////////////////
	for (i=0; i<n; i++)
	{
		free(ppdDist[i]);
	}
	free(ppdDist);
	free(pcPoint);
	return 0;
}


int main()
{
	struct info1
	{
		int a[3];
	}
	point[N];
	struct info2
	{
		int f[3],l[3];
		double result;
	}
	dist[N*(N-1)/2];
	int n,i,j,k=0,p;
	double tmpdist;
	int tmppoint;
	scanf("%d",&n);
	for (i=0;i<n;i++)
	{
		scanf("%d %d %d",&point[i].a[0],&point[i].a[1],&point[i].a[2]);
	}
	for (i=0;i<n;i++)
	{
		for (j=i+1;j<n;j++)
		{
			dist[k].result=sqrt((double)(point[i].a[0]-point[j].a[0])*(point[i].a[0]-point[j].a[0])+(point[i].a[1]-point[j].a[1])*(point[i].a[1]-point[j].a[1])+(point[i].a[2]-point[j].a[2])*(point[i].a[2]-point[j].a[2]));
			for (p=0;p<3;p++)
			{
				dist[k].f[p]=point[i].a[p];
				dist[k].l[p]=point[j].a[p];
			}
			k++;
		}
	}
	for (j=1;j<k;j++)
	{
		for (i=0;i<k-j;i++)
		{
			if (dist[i].result<dist[i+1].result)
			{
				tmpdist=dist[i].result;
				dist[i].result=dist[i+1].result;
				dist[i+1].result=tmpdist;
				for (p=0;p<3;p++)
				{
					tmppoint=dist[i].f[p];
					dist[i].f[p]=dist[i+1].f[p];
					dist[i+1].f[p]=tmppoint;
					tmppoint=dist[i].l[p];
					dist[i].l[p]=dist[i+1].l[p];
					dist[i+1].l[p]=tmppoint;
				}
			}
		}
	}
	for (i=0;i<k;i++)
	{
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",dist[i].f[0],dist[i].f[1],dist[i].f[2],dist[i].l[0],dist[i].l[1],dist[i].l[2],dist[i].result);
	}
	return 0;
}


struct POINT {
	int x;
	int y;
	int z;
};
struct DIST {
	int a;
	int b;
	double dis;
};
int main()
{
	int n,i,j,k,t;
	double td;
	struct POINT point[20];
	struct DIST dists[200];
    scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d%d%d",&point[i].x,&point[i].y,&point[i].z);
	}
	k=0;
	for(i=0;i<n;i++)
	{
		for(j=i+1;j<n;j++)
		{
			dists[k].a=i;
			dists[k].b=j;
			dists[k].dis=sqrt((point[i].x-point[j].x)*(point[i].x-point[j].x)+
				(point[i].y-point[j].y)*(point[i].y-point[j].y)+(point[i].z-point[j].z)*(point[i].z-point[j].z));
			k++;
		}
	}
	for(i=0;i<k;i++)
	{
		for(j=k-1;j>i;j--)
		{
			if(dists[j].dis>dists[j-1].dis)
			{
				t=dists[j].a;
				dists[j].a=dists[j-1].a;
				dists[j-1].a=t;
				t=dists[j].b;
				dists[j].b=dists[j-1].b;
				dists[j-1].b=t;
				td=dists[j].dis;
				dists[j].dis=dists[j-1].dis;
				dists[j-1].dis=td;
			}
		}
	}
	for(i=0;i<k;i++)
	{
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",
			point[dists[i].a].x,point[dists[i].a].y,point[dists[i].a].z,
			point[dists[i].b].x,point[dists[i].b].y,point[dists[i].b].z,
			dists[i].dis);
	}
	return 0;
}


//********************************
//*???????                 **
//*?????? 1200012839        **
//*???2012.12.10              **
//********************************
int main()
{
    int n, k = 0;
    cin >> n;
    struct point
    {
        int x;
        int y;
        int z;
    }point[n];
    struct distance
    {
        int pointa;
        int pointb;
        double d;
    }dis[4950],temp;
    for (int i = 0; i < n; i++)
    {
        cin >> point[i].x >> point[i].y >> point[i].z;
    }
    for (int i=0;i<n-1;i++)
    {
        for (int j=i+1;j<n;j++)
        {
            dis[k].d = sqrt((point[i].x - point[j].x) * (point[i].x - point[j].x)
                          + (point[i].y - point[j].y) * (point[i].y - point[j].y)
                          + (point[i].z - point[j].z) * (point[i].z - point[j].z));
            dis[k].pointa = i;
            dis[k].pointb = j;
            k++;
        }
    }
    for (int i = 0; i < n * (n - 1) / 2 - 1; i++)
    {
        for (int j = i + 1; j < n * (n - 1) / 2; j++)
        {
            if (dis[i].d < dis[j].d)
            {
                temp = dis[i];
                dis[i] = dis[j];
                dis[j] = temp;
            }
            if (dis[i].d == dis[j].d && (dis[i].pointa > dis[j].pointa || dis[i].pointb > dis[j].pointb))
            {
                temp = dis[i];
                dis[i] = dis[j];
                dis[j] = temp;
            }
        }
    }
    for (int i = 0; i < n * (n - 1) / 2; i++)
    {
        cout << "(" << point[dis[i].pointa].x << "," << point[dis[i].pointa].y << "," << point[dis[i].pointa].z << ")" << "-"
             << "(" << point[dis[i].pointb].x << "," << point[dis[i].pointb].y << "," << point[dis[i].pointb].z << ")" << "="
             << fixed << setprecision(2) << dis[i].d << endl;
    }
    return 0;
}


int main()
{
	typedef struct _Point
	{
		int x,y,z;
	} Point;
	typedef struct _Distance
	{
		int first, second;
		float dist;
	} Distance;
	Point point[10];
	int n;
	scanf("%d", &n);
	int i,j,total = n*(n-1)>>1;
	n--;
	for(i=0; i<=n; i++)
		scanf("%d%d%d", &point[i].x, &point[i].y, &point[i].z);
	Distance * pDistance = (Distance *)malloc(total * sizeof(Distance));
	int k = 0;
	for(i=0; i<n; i++)
		for(j=i+1; j<=n; j++)
		{
			pDistance[k].first = i;
			pDistance[k].second = j;
			pDistance[k].dist = sqrt((float)((point[i].x-point[j].x)*(point[i].x-point[j].x) +
				(point[i].y-point[j].y)*(point[i].y-point[j].y) +
				(point[i].z-point[j].z)*(point[i].z-point[j].z)));
			k++;
		}
	for(i=1; i<total; i++)
	{
		int tmp = total - i;
		for(j=0; j<tmp; j++)
			if(pDistance[j].dist < pDistance[j+1].dist)
			{
				Distance tmp = pDistance[j];
				pDistance[j] = pDistance[j+1];
				pDistance[j+1] = tmp;
			}
	}
	for(i=0; i<k; i++)
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n", point[pDistance[i].first].x, point[pDistance[i].first].y,
		point[pDistance[i].first].z, point[pDistance[i].second].x, point[pDistance[i].second].y,
		point[pDistance[i].second].z, pDistance[i].dist);
	free(pDistance);
	return 0;
}


struct distance
{
	double d;
	int dx;
	int dy;
}dis[100] = {0}, t;
struct point
{
	int x;
	int y;
	int z;
}poi[10] = {0};
void input(int);
void calculate(int);
void arrange(int);
void output(int);
int main()
{
	int n;
	cin >> n;
	input(n);
	calculate(n);
	arrange(n);
	output(n);
	return 0;
}
void input(int n)
{
	int i;
	for(i = 0; i <
		n; i++)
	{
		cin >> poi[i].x >> poi[i].y >> poi[i].z;
	}
}
void calculate(int n)
{
	int i;
/*	for(i = 0; i < n * n; i++)
	{
		dis[i].d = sqrt((poi[i/n].x - poi[i%n].x) * (poi[i/n].x - poi[i%n].x)+
			            (poi[i/n].y - poi[i%n].y) * (poi[i/n].y - poi[i%n].y)+
                        (poi[i/n].z - poi[i%n].z) * (poi[i/n].z - poi[i%n].z));
		dis[i].dx = i / n;
		dis[i].dy = i % n;
	}
*/
	int x1 = 0, y1 = 1;
	for(i = 0; i < n * (n - 1) / 2; i++)
	{
		dis[i].d = sqrt((poi[x1].x - poi[y1].x) * (poi[x1].x - poi[y1].x) +
			            (poi[x1].y - poi[y1].y) * (poi[x1].y - poi[y1].y) +
						(poi[x1].z - poi[y1].z) * (poi[x1].z - poi[y1].z));
		dis[i].dx = x1;
		dis[i].dy = y1;
		y1++;
		if(y1 == n)
		{
			x1++;
			y1 = x1 + 1;
		}
	}

	return;
}

void arrange(int n)
{
	int i;
	int j;
	for(i = 0; i < n * (n - 1) / 2 - 1; i++)
	{
		for(j = 0; j < n * (n - 1) / 2 - i - 1; j++)
		{
			if(dis[j].d < dis[j + 1].d)
			{
				t = dis[j];
				dis[j] = dis[j + 1];
				dis[j + 1] = t;

			}
		}
	}
	return;
}

void output(int n)
{
	int i;
	for(i = 0; i < n * (n - 1) / 2; i++)  //(0,0,0)-(1,1,1)=1.73
	{
		cout << "(" << poi[dis[i].dx].x << "," << poi[dis[i].dx].y << "," << poi[dis[i].dx].z << ")-("
			 << poi[dis[i].dy].x << "," << poi[dis[i].dy].y << "," << poi[dis[i].dy].z << ")="
			 << setprecision(2) << fixed <<dis[i].d << endl;
	}
	return;

}


int main(){
   int n;
   scanf("%d",&n);
   int *x=(int*)malloc(sizeof(int)*n);
   int *y=(int*)malloc(sizeof(int)*n);
   int *z=(int*)malloc(sizeof(int)*n);
   int i,j;
   for(i=0;i<n;i++){
      scanf("%d%d%d",&x[i],&y[i],&z[i]);
   }
   double *d=(double*)malloc(sizeof(double)*((n-1)*n/2));
   int *number1=(int*)malloc(sizeof(int)*((n-1)*n/2));
   int *number2=(int*)malloc(sizeof(int)*((n-1)*n/2));
   int pos=0; //number1?number2??????? (n-1)*n/2
   for(i=0;i<n-1;i++){
      for(j=i+1;j<n;j++){
		 //d[i]=sqrt((x[i]-x[j])^2+(y[i]-y[j])^2+(z[i]-z[j])^2); //~????????
		 d[pos]=sqrt(pow(x[i]-x[j],2)+pow(y[i]-y[j],2)+pow(z[i]-z[j],2));
         number1[pos]=i;
         number2[pos]=j;
		 pos++;
	  }
   }
   int k,f,g;
   double e;
   for(k=1;k<=(n-1)*n/2;k++){
      for(i=0;i<(n-1)*n/2-k;i++){
         if(d[i]<d[i+1]){
		    e=d[i];
            d[i]=d[i+1];
            d[i+1]=e;
            f=number1[i];
            number1[i]=number1[i+1];
            number1[i+1]=f;
            g=number2[i];
            number2[i]=number2[i+1];
            number2[i+1]=g;
		 }
	  }

   }
   for(k=0;k<(n-1)*n/2;k++){
      printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",x[number1[k]],y[number1[k]],z[number1[k]],x[number2[k]],y[number2[k]],z[number2[k]],d[k]);
   }
   free(x);
   free(y);
   free(z);
   free(number1);
   free(number2);
   return 0;
}


typedef struct _DISTANCE{
    float distance;
    int pointa[3];
    int pointb[3];
} DISTANCE;
int main() {
    int n,i,j,k=0,b,m,point[10][3];
    cin>>n;
    for(i=0;i<n;i++){
          for(j=0;j<3;j++){
                 cin>>point[i][j];
          }
    }

    DISTANCE test[n*(n-1)/2];

    for ( i = 0; i <n; ++i)
    {
        for(j=i+1;j<n;j++)
        {
          float distance=sqrt((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]));
             test[k].distance=distance;
             for(m=0;m<3;m++)
             test[k].pointa[m]=point[i][m];
             for(m=0;m<3;m++)
             test[k].pointb[m]=point[j][m];
             k++;
          }
    }

        for ( i = 0; i <n*(n-1)/2-1 ; i++)
          {
              for(j = 0; j <n*(n-1)/2-i-1 ; j++)
              {
                    if(test[j].distance<test[j+1].distance)
                    {
                         DISTANCE temp=test[j+1];
                          test[j+1]=test[j] ;
                          test[j]=temp;
                    }
              }
          }

      for(k=0;k<n*(n-1)/2;k++)
     {
         cout<<"("<<test[k].pointa[0]<<","<<test[k].pointa[1]<<"," <<test[k].pointa[2]<<")"<<"-"<<"("<<test[k].pointb[0]<<","<<test[k].pointb[1]<<"," <<test[k].pointb[2]<<")"<<"=";
         printf("%.2f\n",test[k].distance);
      }

    }


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 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);

}


 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 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);
    }
}


struct Point
{
	int x1;
	int x2;
	int x3;
}point1,point2,p[11];

struct Dis
{
	struct Point point1;
	struct Point point2;
	float d;
}dis[46],tmp;

int main()
{
	int n,i,j,m,k;
	scanf("%d",&n);
	for(i=1;i<=n;i++)
	{
		scanf("%d%d%d",&p[i].x1,&p[i].x2,&p[i].x3);
	}

	for(k=0,m=n-1;m>0;m--)
	{

		for(i=1;i<=m;i++)
		{
			dis[k+i].point1=p[n-m];
			dis[k+i].point2=p[n-m+i];
			dis[k+i].d=sqrt((dis[k+i].point1.x1-dis[k+i].point2.x1)*(dis[k+i].point1.x1-dis[k+i].point2.x1)+(dis[k+i].point1.x2-dis[k+i].point2.x2)*(dis[k+i].point1.x2-dis[k+i].point2.x2)+(dis[k+i].point1.x3-dis[k+i].point2.x3)*(dis[k+i].point1.x3-dis[k+i].point2.x3));
		}
		k=k+m;
	}

	for(i=1;i<(n*(n-1)/2);i++)
	{
		for(j=1;j<=(n*(n-1)/2-i);j++)
		{
			if(dis[j].d<dis[j+1].d)
			{
				tmp=dis[j];
				dis[j]=dis[j+1];
				dis[j+1]=tmp;
			}
		}
	}

	for(i=1;i<=n*(n-1)/2;i++)
	{
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n",dis[i].point1.x1,dis[i].point1.x2,dis[i].point1.x3,dis[i].point2.x1,dis[i].point2.x2,dis[i].point2.x3,dis[i].d);
	}
	return 0;
}


struct zuobiao
{
	int x;
	int y;
	int z;
};
struct zuhe
{
	struct zuobiao dian1;
	struct zuobiao dian2;
	double s;
};
double juli(int x3,int y3,int z3,int x4,int y4,int z4)
{
	double d;
	d=(x4-x3)*(x4-x3)+(y4-y3)*(y4-y3)+(z4-z3)*(z4-z3);
	d=sqrt(d);
	return d;
}
int main()
{
	struct zuobiao dian[20];
	struct zuhe zu[100];
	struct zuhe c;
	int n,m,i,j,k=0;
	double l;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d%d%d",&dian[i].x,&dian[i].y,&dian[i].z);
	}
	m=n*(n-1)/2;
	for(i=0;i<m;i++)
	{
		for(j=i+1;j<n;j++)
		{
			l=juli(dian[i].x,dian[i].y,dian[i].z,dian[j].x,dian[j].y,dian[j].z);
			zu[k].dian1=dian[i];
			zu[k].dian2=dian[j];
			zu[k].s=l;
			k++;
		}
	}
	for(i=1;i<m;i++)
	{
		for(j=0;j<m-1;j++)
		{
			if(zu[j].s<zu[j+1].s)
			{
				c=zu[j];
				zu[j]=zu[j+1];
				zu[j+1]=c;
			}
		}
	}
	for(i=0;i<m;i++)
	{
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",zu[i].dian1.x,zu[i].dian1.y,zu[i].dian1.z,zu[i].dian2.x,zu[i].dian2.y,zu[i].dian2.z,zu[i].s);
	}
}


struct node
{
    int x,y,z;
}p[10];
struct d
{
    double d;
    int p1,p2;
}dis[45];
int n,t=0;

double dist(int x,int y)
{
    int dx=p[x].x-p[y].x,dy=p[x].y-p[y].y,dz=p[x].z-p[y].z;
    return sqrt(1.0*dx*dx+1.0*dy*dy+1.0*dz*dz);
}

void swap(int i,int j)
{
    struct d tmp=dis[i];
    dis[i]=dis[j];
    dis[j]=tmp;
}

void init()
{
    int i,j;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        scanf("%d%d%d",&p[i].x,&p[i].y,&p[i].z);
    }
    for(i=0;i<n;i++)
    {
        for(j=i+1;j<n;j++)
        {
            dis[t].p1=i;dis[t].p2=j;
            dis[t].d=dist(i,j);
            t++;
        }
    }
}

void solve()
{
    int i,j;
    for(i=0;i<t;i++)
    {
        for(j=0;j<t-i-1;j++)
        {
            if(dis[j].d<dis[j+1].d)
            {
                swap(j,j+1);
            }
        }

    }
}

void print()
{
    int i;
    for(i=0;i<t;i++)
    {
        printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",p[dis[i].p1].x,p[dis[i].p1].y,p[dis[i].p1].z,
                                 p[dis[i].p2].x,p[dis[i].p2].y,p[dis[i].p2].z,dis[i].d);
    }
}

int main()
{
    init();
    solve();
    print();
    return 0;
}


struct zuobiao
{
	int x,y,z;
}zuo[10];
struct dis
{
	int left[3],right[3];
	float d;
}di[100],e;
int main()
{
	int l,n,ld,i,j;
	scanf("%d",&n);
	l=n*(n-1)/2;
	ld=0;
	for(i=0;i<n;i++)
		scanf("%d%d%d",&zuo[i].x,&zuo[i].y,&zuo[i].z);
	for(i=0;i<n-1;i++)
		for(j=i+1;j<n;j++)
		{
			di[ld++].d=sqrt(pow(zuo[i].x-zuo[j].x,2)+pow(zuo[i].y-zuo[j].y,2)+pow(zuo[i].z-zuo[j].z,2));
			di[ld-1].left[0]=zuo[i].x;
			di[ld-1].left[1]=zuo[i].y;
			di[ld-1].left[2]=zuo[i].z;
			di[ld-1].right[0]=zuo[j].x;
			di[ld-1].right[1]=zuo[j].y;
			di[ld-1].right[2]=zuo[j].z;
		}
		for(i=1;i<l;i++)
			for(j=0;j<l-i;j++)
				if(di[j].d<di[j+1].d)
				{
					e=di[j];
					di[j]=di[j+1];
					di[j+1]=e;
				}
				for(i=0;i<l;i++)
					printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n",di[i].left[0],di[i].left[1],di[i].left[2],di[i].right[0],di[i].right[1],di[i].right[2],di[i].d);

				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].p>temp[w].q){
        te=temp[w].q;
        temp[w].q=temp[w].p;
        temp[w].p=te;
    }
        if(temp[w].dist!=-1)
        {
            printf("(%d,%d,%d)-",point[temp[w].p].x,point[temp[w].p].y,point[temp[w].p].z);
            printf("(%d,%d,%d)=",point[temp[w].q].x,point[temp[w].q].y,point[temp[w].q].z);
            printf("%.2lf\n",temp[w].dist);
        }
    }
    return 0;
}


/*
 * ????????.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 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;
}


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 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;
}