#include <stdio.h>

typedef struct
{
    char m_Name[21];
    int  m_taxi,m_pizza,m_girl;
} Preson_t;
Preson_t P[100];

int main()
{
    int N,M,a,b,c,Taxi,Pizza,Girl,i;
    char flag;
    scanf("%d",&N);
    for(i=0; i<N; ++i)
    {
        scanf("%d %s",&M,P[i].m_Name);
        while(M--)
        {
            scanf("%d-%d-%d",&a,&b,&c);
            if(a==b&&b==c&&a/10==a%10)
            {
                ++P[i].m_taxi;
            }
            else if(a>b&&b>c&&a/10>a%10&&b/10>b%10&&c/10>c%10)
            {
                ++P[i].m_pizza;
            }
            else
            {
                ++P[i].m_girl;
            }
        }
    }
    Taxi=Pizza=Girl=0;
    for(i=0; i<N; ++i)
    {
        if(P[i].m_taxi>Taxi)
        {
            Taxi=P[i].m_taxi;
        }
        if(P[i].m_pizza>Pizza)
        {
            Pizza=P[i].m_pizza;
        }
        if(P[i].m_girl>Girl)
        {
            Girl=P[i].m_girl;
        }
    }
    printf("If you want to call a taxi, you should call:");
    flag=0;
    for(i=0; i<N; ++i)
    {
        if(P[i].m_taxi==Taxi)
        {
            if(flag)
            {
                printf(",");
            }
            printf(" %s",P[i].m_Name);
            flag=1;
        }
    }
    printf(".\n");
    printf("If you want to order a pizza, you should call:");
    flag=0;
    for(i=0; i<N; ++i)
    {
        if(P[i].m_pizza==Pizza)
        {
            if(flag)
            {
                printf(",");
            }
            printf(" %s",P[i].m_Name);
            flag=1;
        }
    }
    printf(".\n");
    printf("If you want to go to a cafe with a wonderful girl, you should call:");
    flag=0;
    for(i=0; i<N; ++i)
    {
        if(P[i].m_girl==Girl)
        {
            if(flag)
            {
                printf(",");
            }
            printf(" %s",P[i].m_Name);
            flag=1;
        }
    }
    printf(".\n");
    return 0;
}


#include <stdio.h>

typedef struct
{
    char m_Name[21];
    int  m_taxi,m_pizza,m_girl;
} Preson_t;
Preson_t P[100];

int main()
{
    int N,M,a,b,c,Taxi,Pizza,Girl,i;
    char flag;
    scanf("%d",&N);
    for(i=0; i<N; ++i)
    {
        scanf("%d %s",&M,P[i].m_Name);
        while(M--)
        {
            scanf("%d-%d-%d",&a,&b,&c);
            if(a==b&&b==c&&a/10==a%10)
            {
                ++P[i].m_taxi;
            }
            else if(a>b&&b>c&&a/10!=a%10&&b/10>b%10&&c/10>c%10)
            {
                ++P[i].m_pizza;
            }
            else
            {
                ++P[i].m_girl;
            }
        }
    }
    Taxi=Pizza=Girl=0;
    for(i=0; i<N; ++i)
    {
        if(P[i].m_taxi>Taxi)
        {
            Taxi=P[i].m_taxi;
        }
        if(P[i].m_pizza>Pizza)
        {
            Pizza=P[i].m_pizza;
        }
        if(P[i].m_girl>Girl)
        {
            Girl=P[i].m_girl;
        }
    }
    printf("If you want to call a taxi, you should call:");
    flag=0;
    for(i=0; i<N; ++i)
    {
        if(P[i].m_taxi==Taxi)
        {
            if(flag)
            {
                printf(",");
            }
            printf(" %s",P[i].m_Name);
            flag=1;
        }
    }
    printf(".\n");
    printf("If you want to order a pizza, you should call:");
    flag=0;
    for(i=0; i<N; ++i)
    {
        if(P[i].m_pizza==Pizza)
        {
            if(flag)
            {
                printf(",");
            }
            printf(" %s",P[i].m_Name);
            flag=1;
        }
    }
    printf(".\n");
    printf("If you want to go to a cafe with a wonderful girl, you should call:");
    flag=0;
    for(i=0; i<N; ++i)
    {
        if(P[i].m_girl==Girl)
        {
            if(flag)
            {
                printf(",");
            }
            printf(" %s",P[i].m_Name);
            flag=1;
        }
    }
    printf(".\n");
    return 0;
}


#include <stdio.h>
#include <string.h>

int taxi[107], pizza[107], girl[107];
char name[107][27], str[10];
int n;

void printtaxi()
{
    int i, maxind = 0, max = -1, cnt = 0;
    for(i = 0; i < n; i++)
	if(taxi[i] > max) {
	    max = taxi[i]; maxind = i; }
    for(i = 0; i < n; i++)
	if(taxi[i] == max)
	    cnt++;
    printf("If you want to call a taxi, you should call: ");
    if(cnt == 1)
	printf("%s.\n", name[maxind]);
    else
    {
	for(i = 0; i < n && cnt > 1; i++)
	    if(taxi[i] == max) {
		printf("%s, ", name[i]); cnt--; }
	while(taxi[i] != max) i++;
	printf("%s.\n", name[i]);
    }
}

void printpizza()
{
    int i, maxind = 0, max = -1, cnt = 0;
    for(i = 0; i < n; i++)
    	if(pizza[i] > max) {
    		max = pizza[i]; maxind = i; }
    for(i = 0; i < n; i++)
		if(pizza[i] == max)
	    	cnt++;
    printf("If you want to order a pizza, you should call: ");
    if(cnt == 1)
		printf("%s.\n", name[maxind]);
    else
    {
		for(i = 0; i < n && cnt > 1; i++)
	    	if(pizza[i] == max) {
				printf("%s, ", name[i]); cnt--; }
		while(pizza[i] != max) i++;
		printf("%s.\n", name[i]);
    }
}

void printgirl()
{
    int i, maxind = 0, max = -1, cnt = 0;
    for(i = 0; i < n; i++)
    	if(girl[i] > max) {
    		max = girl[i]; maxind = i; }
    for(i = 0; i < n; i++)
		if(girl[i] == max)
	    	cnt++;
    printf("If you want to go to a cafe with a wonderful girl, you should call: ");
    if(cnt == 1)
		printf("%s.\n", name[maxind]);
    else
    {
		for(i = 0; i < n && cnt > 1; i++)
	    	if(girl[i] == max) {
				printf("%s, ", name[i]); cnt--; }
		while(girl[i] != max) i++;
		printf("%s.\n", name[i]);
    }
}

int main()
{
    int i, num; scanf("%d", &n);
    for(i = 0; i < n; i++)
    {
	scanf("%d %s", &num, name[i]);
	while(num--)
	{
	    scanf("%s", str);
	    char pho[3][3];
	    pho[0][0] = str[0]; pho[0][1] = str[1]; pho[0][2] = '\0';
	    pho[1][0] = str[3]; pho[1][1] = str[4]; pho[1][2] = '\0';
	    pho[2][0] = str[6]; pho[2][1] = str[7]; pho[2][2] = '\0';
	    if(!strcmp(pho[0], pho[1]) && !strcmp(pho[1], pho[2]))
			taxi[i]++;
		else
		{
			int ok = 0;
			if(pho[0][0] > pho[0][1] && pho[0][1] > pho[1][0] && pho[1][0] > pho[1][1] && pho[1][1] > pho[2][0] && pho[2][0] > pho[2][1])
				ok = 1;
			if(!ok) girl[i]++;
			else pizza[i]++;
		}
	}
	}
    printtaxi();
    printpizza();
    printgirl();
    return 0;
}


#include <stdio.h>
#include <string.h>

int taxi[107], pizza[107], girl[107];
char name[107][27], str[10];
int n;

void printtaxi()
{
    int i, maxind = 0, max = -1, cnt = 0;
    for(i = 0; i < n; i++)
	if(taxi[i] > max) {
	    max = taxi[i]; maxind = i; }
    for(i = 0; i < n; i++)
	if(taxi[i] == max)
	    cnt++;
    printf("If you want to call a taxi, you should call: ");
    if(cnt == 1)
	printf("%s.\n", name[maxind]);
    else
    {
	for(i = 0; i < n && cnt > 1; i++)
	    if(taxi[i] == max) {
		printf("%s, ", name[i]); cnt--; }
	while(taxi[i] != max) i++;
	printf("%s.\n", name[i]);
    }
}

void printpizza()
{
    int i, maxind = 0, max = -1, cnt = 0;
    for(i = 0; i < n; i++)
    	if(pizza[i] > max) {
    		max = pizza[i]; maxind = i; }
    for(i = 0; i < n; i++)
		if(pizza[i] == max)
	    	cnt++;
    printf("If you want to order a pizza, you should call: ");
    if(cnt == 1)
		printf("%s.\n", name[maxind]);
    else
    {
		for(i = 0; i < n && cnt > 1; i++)
	    	if(pizza[i] == max) {
				printf("%s, ", name[i]); cnt--; }
		while(pizza[i] != max) i++;
		printf("%s.\n", name[i]);
    }
}

void printgirl()
{
    int i, maxind = 0, max = -1, cnt = 0;
    for(i = 0; i < n; i++)
    	if(girl[i] > max) {
    		max = girl[i]; maxind = i; }
    for(i = 0; i < n; i++)
		if(girl[i] == max)
	    	cnt++;
    printf("If you want to go to a cafe with a wonderful girl, you should call: ");
    if(cnt == 1)
		printf("%s.\n", name[maxind]);
    else
    {
		for(i = 0; i < n && cnt > 1; i++)
	    	if(girl[i] == max) {
				printf("%s, ", name[i]); cnt--; }
		while(girl[i] != max) i++;
		printf("%s.\n", name[i]);
    }
}

int main()
{
    int i, num; scanf("%d", &n);
    for(i = 0; i < n; i++)
    {
	scanf("%d %s", &num, name[i]);
	while(num--)
	{
	    scanf("%s", str);
	    char pho[7]; int j, piz = 1, tax = 1;
	    pho[0] = str[0]; pho[1] = str[1];
	    pho[2] = str[3]; pho[3] = str[4];
	    pho[4] = str[6]; pho[5] = str[7];
	    pho[6] = '\0';
	    for(j = 0; j < 5; j++)
	    	if(pho[j] != pho[j + 1]) {
	    		tax = 0; break; }
	    for(j = 0; j < 5; j++)
	    	if(pho[j] <= pho[j + 1]) {
	    		piz = 0; break; }
	    if(tax)
			taxi[i]++;
		else
		{
			if(!piz) girl[i]++;
			else pizza[i]++;
		}
	}
	}
    printtaxi();
    printpizza();
    printgirl();
    return 0;
}


#include<stdio.h>
#include<string.h>

int main()
{
int n,ng[100],np[100],nt[100],s[100],i,j,k,temp,max,maxp,maxt,maxg;
char str[100][30],phno[100][20],tt[30];
scanf("%d",&n);
for(i=0;i<n;i++)
 np[i]=ng[i]=nt[i]=0;
for(i=0;i<n;i++)
{
  scanf("%d %s",&s[i],&str[i]);
  for(j=0;j<s[i];j++)
   scanf("%s",&phno[j]);
for(j=0;j<s[i];j++)
 {
  temp=phno[j][0];
  for(k=0;k<strlen(phno[j]);k++)
  {
   if(phno[j][k]!='-')
   {
    if(temp!=phno[j][k])
     break;
   }
  }
 if(k==(strlen(phno[j])))
  nt[i]++;
 else
  {
   temp=0;
   for(k=0;k<strlen(phno[j]);k++)
    if(phno[j][k]!='-')
     tt[temp++]=phno[j][k];
   tt[temp]=0;
   for(k=1;k<temp;k++)
    if(tt[k]>=tt[k-1])
     break;
  // printf("%s %d\n",tt,k);
   if(k==temp)
    np[i]++;
   else
    ng[i]++;
  }
 }
}
//for(i=0;i<n;i++)
// printf("%d %d %d\n",nt[i],np[i],ng[i]);
max=maxp=maxg=maxt=0;
for(i=0;i<n;i++)
 if(nt[i]>nt[max])
  max=i;
for(i=0;i<n;i++)
 if((nt[i]==nt[max]))
  maxt++;
printf("If you want to call a taxi, you should call:");
for(i=0;i<n;i++)
 {
  if((nt[i]==nt[max]))
   {
   printf(" %s",str[i]);
   maxt--;
  if(maxt)
   printf(",");
   }
 }
printf(".\n");
printf("If you want to order a pizza, you should call:");
max=0;
for(i=0;i<n;i++)
 if(np[i]>np[max])
  max=i;
for(i=0;i<n;i++)
 if((np[i]==np[max]))
  maxp++;
for(i=0;i<n;i++)
 {
  if((np[i]==np[max]))
  {
   printf(" %s",str[i]);
  maxp--;
  if(maxp)
   printf(",");
  }
 }
printf(".\n");
printf("If you want to go to a cafe with a wonderful girl, you should call:");
max=0;
for(i=0;i<n;i++)
 if(ng[i]>ng[max])
  max=i;
for(i=0;i<n;i++)
 if((ng[i]==ng[max]))
  maxg++;
for(i=0;i<n;i++)
 {
  if((ng[i]==ng[max]))
  {
   printf(" %s",str[i]);
    maxg--;
  if(maxg)
   printf(",");
  }
 }
printf(".\n");
return 0;
}


#include<stdio.h>
#include<string.h>

int main()
{
int n,ng[100],np[100],nt[100],s[100],i,j,k,temp,max,maxp,maxt,maxg;
char str[100][30],phno[100][20],tt[30];
scanf("%d",&n);
for(i=0;i<n;i++)
 np[i]=ng[i]=nt[i]=0;
for(i=0;i<n;i++)
{
  scanf("%d %s",&s[i],&str[i]);
  for(j=0;j<s[i];j++)
   scanf("%s",&phno[j]);
for(j=0;j<s[i];j++)
 {
  temp=phno[j][0];
  for(k=0;k<strlen(phno[j]);k++)
  {
   if(phno[j][k]!='-')
   {
    if(temp!=phno[j][k])
     break;
   }
  }
 if(k==(strlen(phno[j])))
  nt[i]++;
 else
  {
   temp=0;
   for(k=0;k<strlen(phno[j]);k++)
    if(phno[j][k]!='-')
     tt[temp++]=phno[j][k];
   tt[temp]=0;
   for(k=1;k<temp;k++)
    if(tt[k]>=tt[k-1])
     break;
  // printf("%s %d\n",tt,k);
   if(k==temp)
    np[i]++;
   else
    ng[i]++;
  }
 }
}
//for(i=0;i<n;i++)
// printf("%d %d %d\n",nt[i],np[i],ng[i]);
max=maxp=maxg=maxt=0;
for(i=0;i<n;i++)
 if(nt[i]>nt[max])
  max=i;
for(i=0;i<n;i++)
 if((nt[i]==nt[max])&&(nt[i]!=0))
  maxt++;
printf("If you want to call a taxi, you should call:");
for(i=0;i<n;i++)
 {
  if((nt[i]==nt[max])&&(nt[i]!=0))
   {
   printf(" %s",str[i]);
   maxt--;
  if(maxt)
   printf(",");
   }
 }
printf(".\n");
printf("If you want to order a pizza, you should call:");
max=0;
for(i=0;i<n;i++)
 if(np[i]>np[max])
  max=i;
for(i=0;i<n;i++)
 if((np[i]==np[max])&&(np[i]!=0))
  maxp++;
for(i=0;i<n;i++)
 {
  if((np[i]==np[max])&&(np[i]!=0))
  {
   printf(" %s",str[i]);
  maxp--;
  if(maxp)
   printf(",");
  }
 }
printf(".\n");
printf("If you want to go to a cafe with a wonderful girl, you should call:");
max=0;
for(i=0;i<n;i++)
 if(ng[i]>ng[max])
  max=i;
for(i=0;i<n;i++)
 if((ng[i]==ng[max])&&(ng[i]!=0))
  maxg++;
for(i=0;i<n;i++)
 {
  if((ng[i]==ng[max])&&(ng[i]!=0))
  {
   printf(" %s",str[i]);
    maxg--;
  if(maxg)
   printf(",");
  }
 }
printf(".\n");
return 0;
}


#include<stdio.h>
#include<string.h>
#include<ctype.h>
  int main() {
  int n, i, j, taxi[100] = {0}, piza[100] = {0}, girl[100] = {0}, p;
  int f1, f2, f3, k, l, m1, m2, m3, flag;
  char s[105][105], val[100];
  scanf("%d", &n);
  getchar();
  for(i = 0 ; i < n ; i++) {
      scanf("%d %s",&p, s[i]);
      getchar();
      for(j = 0 ; j < p ; j++) {
          scanf("%s",val);
          getchar();
          f1 = f2 = f3 = 1;
          for(k = 0 ,l = strlen(val)-1 ; k <= l ; k++, l--){
              if(isdigit(val[k]) && isdigit(val[l]))
                  if(f1 && val[k] == val[l])
                      continue;
                  else if(f2 && val[k] > val[l])
                      f1 = 0;
                  else
                      f2 = 0;
              }
          if(f1)
              ++taxi[i];
          else if(f2)
              ++piza[i];
          else
              ++girl[i];
      }
  }
  for(i = 0 ; i < n ; i++) {
      if(m1 < taxi[i])
           m1 = taxi[i];
      if(m2 < piza[i])
           m2 = piza[i];
      if(m3 < girl[i])
           m3 = girl[i];
  }

 printf("If you want to call a taxi, you should call:");
    flag=0;
    for(i = 0; i < n ; ++i)
    {
        if(m1 == taxi[i])
        {
            if(flag)
            {
                printf(",");
            }
            printf(" %s",s[i]);
            flag=1;
        }
    }
    printf(".\n");
    printf("If you want to order a pizza, you should call:");
    flag=0;
    for(i = 0 ; i < n ; ++i)
    {
        if(m2 == piza[i])
        {
            if(flag)
            {
                printf(",");
            }
            printf(" %s",s[i]);
            flag=1;
        }
    }
    printf(".\n");
    printf("If you want to go to a cafe with a wonderful girl, you should call:");
    flag=0;
    for(i = 0; i < n; ++i)
    {
        if(m3 == girl[i])
        {
            if(flag)
            {
                printf(",");
            }
            printf(" %s",s[i]);
            flag=1;
        }
    }
    printf(".\n");

  return 0;
  }


#include<stdio.h>
#include<string.h>
#include<ctype.h>
  int main() {
  int n, i, j, taxi[100] = {0}, piza[100] = {0}, girl[100] = {0}, p;
  int f1, f2, f3, k, l, m1, m2, m3, flag, len;
  char s[105][105], val[100];
  scanf("%d", &n);
  getchar();
  for(i = 0 ; i < n ; i++) {
      scanf("%d %s",&p, s[i]);
      getchar();
      for(j = 0 ; j < p ; j++) {
          scanf("%s",val);
          getchar();
          len = strlen(val);
          f1 = f2 = f3 = 0;
          for(k = 0 , l = k+1; k < len - 1; l++, k++) {
                  if(!isdigit(val[k]))
                      k++;
                  if(!isdigit(val[l]))
                      l++;
                  if(f1 != -1 && val[k] == val[l])
                      f1 = 1;
                  else if(f2 != -1 && f1 != 1 && f3 != 1 && val[k] > val[l]) {
                      f2 = 1;
                      f1 = -1;
                  }
                  else {
                      f3 = 1;
                      f1 = f2 = -1;
                  }
          }
          if(f1 == 1)
              ++taxi[i];
          if(f2 == 1)
              ++piza[i];
          if(f3 == 1)
              ++girl[i];
      }
  }
  for(i = 0 ; i < n ; i++) {
      if(m1 < taxi[i])
           m1 = taxi[i];
      if(m2 < piza[i])
           m2 = piza[i];
      if(m3 < girl[i])
           m3 = girl[i];
  }
 printf("If you want to call a taxi, you should call:");
    flag=0;
    for(i = 0; i < n ; ++i)
    {
        if(m1 == taxi[i])
        {
            if(flag)
            {
                printf(",");
            }
            printf(" %s",s[i]);
            flag=1;
        }
    }
    printf(".\n");
    printf("If you want to order a pizza, you should call:");
    flag=0;
    for(i = 0 ; i < n ; ++i)
    {
        if(m2 == piza[i])
        {
            if(flag)
            {
                printf(",");
            }
            printf(" %s",s[i]);
            flag=1;
        }
    }
    printf(".\n");
    printf("If you want to go to a cafe with a wonderful girl, you should call:");
    flag=0;
    for(i = 0; i < n; ++i)
    {
        if(m3 == girl[i])
        {
            if(flag)
            {
                printf(",");
            }
            printf(" %s",s[i]);
            flag=1;
        }
    }
    printf(".\n");

  return 0;
  }


#include<stdio.h>
#include<string.h>
#include<ctype.h>
  int main() {
  int n, i, j, taxi[100] = {0}, piza[100] = {0}, girl[100] = {0}, p;
  int f1, f2, f3, k, l, m1, m2, m3;
  char s[105][105], val[100];
  scanf("%d", &n);
  getchar();
  for(i = 0 ; i < n ; i++) {
      scanf("%d %s",&p, s[i]);
      getchar();
      for(j = 0 ; j < p ; j++) {
          scanf("%s",val);
          getchar();
          f1 = f2 = f3 = 1;
          for(k = 0 ,l = strlen(val)-1 ; k <= l ; k++, l--){
              if(isdigit(val[k]) && isdigit(val[l]))
                  if(f1 && val[k] == val[l])
                      continue;
                  else if(f2 && val[k] > val[l])
                      f1 = 0;
                  else
                      f2 = 0;
              }
          if(f1)
              ++taxi[i];
          else if(f2)
              ++piza[i];
          else
              ++girl[i];
      }
  }
  for(i = 0 ; i < n ; i++) {
      if(m1 < taxi[i])
           m1 = taxi[i];
      if(m2 < piza[i])
           m2 = piza[i];
      if(m3 < girl[i])
           m3 = girl[i];
  }
  printf("If you want to call a taxi, you should call: ");
  for(i = 0 ; i < n ; i++)
      if(m1 == taxi[i])
          printf("%s ",s[i]);
  printf("\nIf you want to order a pizza, you should call: ");
  for(i = 0 ; i < n ; i++)
      if(m2 == piza[i])
          printf("%s ",s[i]);
  printf("\nIf you want to go to a cafe with a wonderful girl, you should call: ");
  for(i = 0 ; i < n ; i++)
      if(m3 == girl[i])
          printf("%s ",s[i]);
  return 0;
  }


#include<stdio.h>
#include<stdlib.h>

struct str_friends{
    char name[22];
    int cars , pizza , girls;
};

struct str_friends friends[100];
char phone[10];

int main(){
    int i, num;
    int max_cars = 0, max_pizza = 0, max_girls = 0;
    scanf( "%d", &num );

    for( i=0; i<num; i++ ){
        int j, phone_num;
        scanf( "%d %s", &phone_num, friends[i].name );
        friends[i].cars = friends[i].pizza = friends[i].girls = 0;

        for( j=0; j<phone_num; j++ ){
            scanf( "%s", phone );

            if( phone[0] == phone[1] && phone[1] == phone[3] && phone[3] == phone[4] && phone[4] == phone[6] && phone[6] == phone[7] )
                friends[i].cars++;
            else if( phone[0] > phone[1] && phone[1] > phone[3] && phone[3] > phone[4] && phone[4] > phone[6] && phone[6] > phone[7])
                friends[i].pizza++;
            else
                friends[i].girls++;

        }

        if( friends[i].cars > friends[max_cars].cars )
            max_cars = i;
        if( friends[i].pizza > friends[max_pizza].pizza )
            max_pizza = i;
        if( friends[i].girls > friends[max_girls].girls )
            max_girls = i;
    }

    printf( "If you want to call a taxi, you should call: %s", friends[max_cars].name );
    for( i=0; i<num; i++ )
        if( friends[i].cars == friends[max_cars].cars && i != max_cars)
            printf( ", %s", friends[i].name );
    printf( ".\n" );
    printf( "If you want to order a pizza, you should call: %s", friends[max_pizza].name );
    for( i=0; i<num; i++ )
        if( friends[i].pizza == friends[max_pizza].pizza && i != max_pizza )
            printf( ", %s", friends[i].name );
    printf( ".\n" );
    printf( "If you want to go to a cafe with a wonderful girl, you should call: %s", friends[max_girls].name );
    for( i=0; i<num; i++ )
        if( friends[i].girls == friends[max_girls].girls && i != max_girls )
            printf( ", %s", friends[i].name );
    printf( ".\n" );

    return 0;
}


#include<stdio.h>
#include<ctype.h>
#include<string.h>
#include<malloc.h>
void sort(int f[],int n,char s[100],char p[100][21])
{
int x,y,t,g1=0;
char a[2500],g[100][21],j[21];
for(x=0;x<n;x++)
strcpy(g[x],p[x]);
for(x=0;x<n;x++)
{
for(y=x+1;y<n;y++)
{
if(f[y]>f[x])
{
t=f[x];
f[x]=f[y];
f[y]=t;
strcpy(j,g[x]);
strcpy(g[x],g[y]);
strcpy(g[y],j);
}}}
t=f[0];
for(x=1;x<n;x++)
{
if(f[x]==t)
g1++;
else
break;
}
strcpy(a,s);
for(x=0;x<=g1;x++)
{
strcat(a,g[x]);
if(x==g1)
strcat(a,".");
else
strcat(a,", ");
}
printf("%s",a);
}

main()
{
    int n,x,y,z,u=0,v=0,w=0,r,*f[3];
    char s[21],a[100][21],c[9],t;
    scanf("%d",&n);
    for(x=0;x<3;x++)
    f[x]=(int*)calloc(n,sizeof(int));
    for(x=0;x<n;x++)
    {
        scanf("%d%s",&r,s);
        strcpy(a[x],s);
        for(y=0;y<r;y++)
        {
            scanf("%s",c);
            u=0;
            v=0;
            t=c[0];
            for(z=1;z<8;z++)
            {

                if(z!=2 && z!=5)
                {
                   if(c[z]<t)
                   t=c[z];
                   else
                   break;
                   u++;
                }
            }
            t=c[0];
            for(z=1;z<8;z++)
            {

                if(z!=2 && z!=5)
                {
                   if(c[z]!=t)
                   break;
                   v++;
                }
            }
            if(u==5)
            f[0][x]++;
            else if (v==5)
            f[1][x]++;
            else
            f[2][x]++;

        }

    }
    char s1[]="If you want to order a pizza, you should call: ";
    char s2[]="If you want to call a taxi, you should call: ";
    char s3[]="If you want to go to a cafe with a wonderful girl, you should call: ";
    sort(f[1],n,s2,a);
    printf("\n");
    sort(f[0],n,s1,a);
    printf("\n");
    sort(f[2],n,s3,a);

    return(0);
}


#include<stdio.h>
#include<ctype.h>
#include<string.h>
#include<malloc.h>
void sort(int f[],int n,char s[100],char p[100][21])
{
int x,y,t,g1=0;
char a[2500],g[100][21],j[21];
for(x=0;x<n;x++)
strcpy(g[x],p[x]);
for(x=0;x<n;x++)
{
for(y=x+1;y<n;y++)
{
if(f[y]>f[x])
{
t=f[x];
f[x]=f[y];
f[y]=t;
strcpy(j,g[x]);
strcpy(g[x],g[y]);
strcpy(g[y],j);
}}}
t=f[0];
for(x=1;x<n;x++)
{
if(f[x]==t)
g1++;
else
break;
}
strcpy(a,s);
for(x=0;x<=g1;x++)
{
strcat(a,g[x]);
if(x==g1)
strcat(a,".");
else
strcat(a,", ");
}
printf("%s",a);
}

main()
{
    int n,x,y,z,u=0,v=0,w=0,r,*f[3];
    char s[21],a[100][21],c[9],t;
    scanf("%d",&n);
    for(x=0;x<3;x++)
    f[x]=(int*)calloc(n,sizeof(int));
    for(x=0;x<n;x++)
    {
        scanf("%d%s",&r,s);
        strcpy(a[x],s);
        for(y=0;y<r;y++)
        {
            scanf("%s",c);
            u=0;
            v=0;
            for(z=1;z<8;z++)
            {
                t=c[0];
                if(z!=2 && z!=5)
                {
                   if(c[z]<t)
                   t=c[z];
                   else
                   break;
                   u++;
                }
            }
            for(z=1;z<8;z++)
            {
                t=c[0];
                if(z!=2 && z!=5)
                {
                   if(c[z]!=t)
                   break;
                   v++;
                }
            }
            if(u==5)
            f[0][x]++;
            else if (v==5)
            f[1][x]++;
            else
            f[2][x]++;

        }

    }
    char s1[]="If you want to order a pizza, you should call: ";
    char s2[]="If you want to call a taxi, you should call: ";
    char s3[]="If you want to go to a cafe with a wonderful girl, you should call: ";
    sort(f[1],n,s2,a);
    printf("\n");
    sort(f[0],n,s1,a);
    printf("\n");
    sort(f[2],n,s3,a);

    return(0);
}


#include <stdio.h>
int a[101][3];

int main()
{
      int x,y,z;
      int n, i, nnum, flag, j, k;        // flag = 1 : all equal
      scanf("%d", &n);

      char name[n][22];
      char ch, pch, p;
      char num[8];

      for(i=0 ; i<n ; i++)
      {
            scanf("%d %s", &nnum, &name[i][0]);

            while(nnum--)
            {
              //    printf("          %d", nnum);
                  flag = 0;
                  scanf("%c" ,&p);
                  scanf("%s", &num);
                  ch = num[0];
                  for(j=1 ; j<8 ; j++)
                  {
                        if(num[j] == '-')
                              continue;
                        if(ch == num[j])
                              continue;
                        else
                              flag = 1;
                  }

                  if(flag == 0)
                  {

                        a[i][0]++;
                        continue;
                  }

                  ch = num[0];

                  for(j=1 ; j<8 ; j++)
                  {
                        if(num[j] == '-')
                              continue;

                        if(ch > num[j])
                        {
                              ch = num[j];
                              continue;
                        }
                        else
                        {
                              flag = 2;
                              break;
                        }
                  }

                  if(flag == 1)
                  {

                        a[i][1]++;
                        continue;
                  }

                  else
                  {
                        a[i][2]++;
                        continue;
                  }
            }
      }

      x = y = z = 0;
      for(i=0; i<n ; i++)
      {
            if(a[i][0] > x)
                  x = a[i][0];

            if(a[i][1] > y)
                  y = a[i][1];

            if(a[i][2] > z)
                  z = a[i][2];
      }

      printf("If you want to call a taxi, you should call: ");
      flag = 0;
      for(i=0 ; i<n ; i++)
      {
            if(a[i][0] == x)
            {
                  if(flag != 1)
                  {
                        printf("%s", &name[i][0]);
                        flag = 1;
                  }
                  else if(flag == 1)
                  {
                        printf(", %s", &name[i][0]);
                  }
            }
      }
      printf(".\n");

      printf("If you want to order a pizza, you should call: ");
      flag = 0;
      for(i=0 ; i<n ; i++)
      {
            if(a[i][1] == y)
            {
                  if(flag != 1)
                  {
                        printf("%s", &name[i][0]);
                        flag = 1;
                  }
                  else if(flag == 1)
                  {
                        printf(", %s", &name[i][0]);
                  }
            }
      }
      printf(".\n");

      printf("If you want to go to a cafe with a wonderful girl, you should call: ");
      flag = 0;
      for(i=0 ; i<n ; i++)
      {
            if(a[i][2] == z)
            {
                  if(flag != 1)
                  {
                        printf("%s", &name[i][0]);
                        flag = 1;
                  }
                  else if(flag == 1)
                  {
                        printf(", %s", &name[i][0]);
                  }
            }
      }
      printf(".\n");

      return 0;

}


#include<stdio.h>
struct frnd
{
    char name[21];
    int taxi,pizza,girls,index;
}arr[100];

int comparetaxi(struct frnd * a,struct frnd * b)
{
    if(b->taxi - a->taxi)
    return (b->taxi - a->taxi);
    return a->index - b->index;
}
int comparepizza(struct frnd * a,struct frnd * b)
{
    if(b->pizza - a->pizza)
    return (b->pizza - a->pizza);
    return a->index - b->index;
}
int comparegirls(struct frnd * a,struct frnd * b)
{
    if(b->girls - a->girls)
    return (b->girls - a->girls);
    return a->index - b->index;
}

int main()
{
    int n,i;
    scanf("%d",&n);
    int j,num[6];
    for(i=0;i<n;++i)
    {
        arr[i].index=i;
        scanf("%d%s",&j,arr[i].name);
        arr[i].taxi=arr[i].pizza=arr[i].girls=0;
        while(j--)
        {
            scanf("%1d%1d-%1d%1d-%1d%1d",num,num+1,num+2,num+3,num+4,num+5);
            if(num[0]==num[1]&&num[0]==num[2]&&num[0]==num[3]&&num[0]==num[4]&&num[0]==num[5])
            ++arr[i].taxi;
            else if(num[0]>num[1]&&num[1]>num[2]&&num[2]>num[3]&&num[3]>num[4]&&num[4]>num[5])
            ++arr[i].pizza;
            else ++arr[i].girls;
        }
    }

    qsort(arr,n,sizeof(struct frnd),comparetaxi);
    printf("If you want to call a taxi, you should call: %s",arr[0].name);
    for(i=1;arr[i].taxi==arr[0].taxi&&i<n;++i)
    printf(", %s",arr[i].name);
    printf(".\n");

    qsort(arr,n,sizeof(struct frnd),comparepizza);
    printf("If you want to order a pizza, you should call: %s",arr[0].name);
    for(i=1;arr[i].pizza==arr[0].pizza&&i<n;++i)
    printf(", %s",arr[i].name);
    printf(".\n");

    qsort(arr,n,sizeof(struct frnd),comparegirls);
    printf("If you want to go to a cafe with a wonderful girl, you should call: %s",arr[0].name);
    for(i=1;arr[i].girls==arr[0].girls&&i<n;++i)
    printf(", %s",arr[i].name);
    printf(".");
    return 0;

}


#include<stdio.h>
struct frnd
{
    char name[21];
    int taxi,pizza,girls,index;
}arr[100];

int comparetaxi(struct frnd * a,struct frnd * b)
{
    if(b->taxi - a->taxi)
    return (b->taxi - a->taxi);
    return a->index - b->index;
}
int comparepizza(struct frnd * a,struct frnd * b)
{
    if(b->pizza - a->pizza)
    return (b->pizza - a->pizza);
    return a->index - b->index;
}
int comparegirls(struct frnd * a,struct frnd * b)
{
    if(b->girls - a->girls)
    return (b->girls - a->girls);
    return a->index - b->index;
}

int main()
{
    int n,i;
    scanf("%d",&n);
    int j,num[6];
    for(i=0;i<n;++i)
    {
        arr[i].index=i;
        scanf("%d%s",&j,arr[i].name);
        arr[i].taxi=arr[i].pizza=arr[i].girls=0;
        while(j--)
        {
            scanf("%1d%1d-%1d%1d-%1d%1d",num,num+1,num+2,num+3,num+4,num+5);
            if(num[0]==num[1]&&num[0]==num[2]&&num[0]==num[3]&&num[0]==num[4]&&num[0]==num[5])
            ++arr[i].taxi;
            else if(num[0]>num[1]&&num[1]>num[2]&&num[2]>num[3]&&num[3]>num[4]&&num[4]>num[5])
            ++arr[i].pizza;
            else ++arr[i].girls;
        }
    }

    qsort(arr,n,sizeof(struct frnd),comparetaxi);
    printf("If you want to call a taxi, you should call: %s",arr[0].name);
    for(i=1;arr[i].taxi==arr[0].taxi;++i)
    printf(", %s",arr[i].name);
    printf(".\n");

    qsort(arr,n,sizeof(struct frnd),comparepizza);
    printf("If you want to order a pizza, you should call: %s",arr[0].name);
    for(i=1;arr[i].pizza==arr[0].pizza;++i)
    printf(", %s",arr[i].name);
    printf(".\n");

    qsort(arr,n,sizeof(struct frnd),comparegirls);
    printf("If you want to go to a cafe with a wonderful girl, you should call: %s",arr[0].name);
    for(i=1;arr[i].girls==arr[0].girls;++i)
    printf(", %s",arr[i].name);
    printf(".");
    return 0;

}


#include<stdio.h>
#include<string.h>
int main()
{
    struct ss
    {
        char b[100];
    }st[200];
    int max,max1,max2,n,i,j,a,xz[200][4],m,l,k;
    char ar[200];
    scanf("%d",&n);
    max=-1;
    max1=-1;
    max2=-1;
    for(i=0;i<n;i++)
    {
        scanf("%d%s",&a,&st[i].b);
        k=0;
        m=0;l=0;
        for(j=0;j<a;j++)
        {
            scanf("%s",ar);
            if(ar[0]==ar[1]&&ar[1]==ar[3]&&ar[3]==ar[4]&&ar[4]==ar[6]&&ar[6]==ar[7])
            l++;
            else if(ar[0]>ar[1]&&ar[1]>ar[3]&&ar[3]>ar[4]&&ar[4]>ar[6]&&ar[6]>ar[7])
            k++;
            else
            m++;
        }
        xz[i][0]=m;
        xz[i][1]=l;
        xz[i][2]=k;
        if(max<m)
        max=m;
        if(max1<l)
        max1=l;
        if(max2<k)
        max2=k;
    }
    m=0;
    printf("If you want to call a taxi, you should call:");
    for(i=0;i<n;i++)
    {
        if(max1==xz[i][1]){
        if(m!=0)
        printf(",");
        printf(" ");
        printf("%s",st[i].b);
        m++;
        }
    }
    m=0;
    printf(".\n");
    printf("If you want to order a pizza, you should call:");
    for(i=0;i<n;i++)
    {
        if(max2==xz[i][2]){
        if(m!=0)
        printf(",");
        printf(" ");
        printf("%s",st[i].b);
        m++;
        }
    }
    printf(".\n");
    m=0;
    printf("If you want to go to a cafe with a wonderful girl, you should call:");
    for(i=0;i<n;i++)
    {
        if(max==xz[i][0]){
        if(m!=0)
        printf(",");
        printf(" ");
        printf("%s",st[i].b);
        m++;}
    }
    printf(".\n");
}


#include<stdio.h>
#include<string.h>
char name[105][25];
int a[105],b[105],c[105];
int main () {
    int n,i,m,j,x,y,z,max1,max2,max3,c1,c2,c3,d1,d2,d3;
    char ch[6];
    while (scanf("%d",&n) != EOF) {
        memset(a,0,sizeof(a));
        memset(b,0,sizeof(b));
        memset(c,0,sizeof(c));
        for (i=1;i<=n;i++) {
            scanf("%d%s",&m,name[i]);
            getchar();
            for (j=1;j<=m;j++) {
                scanf("%c%c-%c%c-%c%c",&ch[0],&ch[1],&ch[2],&ch[3],&ch[4],&ch[5]);
                getchar();
                if (ch[0]==ch[1]&&ch[1]==ch[2]&&ch[2]==ch[3]&&ch[3]==ch[4]&&ch[4]==ch[5]) {
                    a[i]++;
                } else if (ch[0]>ch[1]&&ch[1]>ch[2]&&ch[2]>ch[3]&&ch[3]>ch[4]&&ch[4]>ch[5]){
                    b[i]++;
                } else {
                    c[i]++;
                }
            }
        }
        max1 = max2 = max3 = -1;
        for (i=1;i<=n;i++) {
            if (a[i]>max1) max1 = a[i];
            if (b[i]>max2) max2 = b[i];
            if (c[i]>max3) max3 = c[i];
        }
        c1 = c2 = c3 = 0;
        for (i=1;i<=n;i++) {
            if (a[i]==max1) c1 ++;
            if (b[i]==max2) c2 ++;
            if (c[i]==max3) c3 ++;
        }
        printf("If you want to call a taxi, you should call:");
        d1 = d2 = d3 = 0;
        for (i=1;i<=n;i++) {
            if (a[i]==max1) {
                d1 ++;
                if (d1<c1) printf(" %s,",name[i]);
                else printf(" %s.",name[i]);
            }
        }
        printf("\n");
        printf("If you want to order a pizza, you should call:");
        for (i=1;i<=n;i++) {
            if (b[i]==max2) {
                d2 ++;
                if (d2<c2) printf(" %s,",name[i]);
                else printf(" %s.",name[i]);
            }
        }
        printf("\n");
        printf("If you want to go to a cafe with a wonderful girl, you should call:");
        for (i=1;i<=n;i++) {
            if (c[i]==max3) {
                d3 ++;
                if (d3<c3) printf(" %s,",name[i]);
                else printf(" %s.",name[i]);
            }
        }
        printf("\n");
    }
    return 0;
}


#include<stdio.h>
int main()
{
    int n,x=0,girl,taxi,pizza,c=0,y,i,num,max;
    scanf("%d",&n);
    char ch;
    char s[8];
    char name[n][20];
    int b[300]={0};
    for(i=0;i<n;i++)
    {
        scanf("%d",&num);
        scanf("%s",&name[i][0]);
        girl=0;taxi=0;pizza=0;
        while(num--)
        {
            scanf("%c",&ch);
            scanf("%s",&s);
            if(s[0]==s[1]&&s[1]==s[3]&&s[3]==s[4]&&s[4]==s[6]&&s[6]==s[7])
            taxi++;
            else if(s[0]>s[1]&&s[1]>s[3]&&s[3]>s[4]&&s[4]>s[6]&&s[6]>s[7])
            pizza++;
            else girl++;
        }
        b[x++]=taxi;
        b[x++]=pizza;
        b[x++]=girl;
    }
printf("If you want to call a taxi, you should call: ");

max=b[0];
for(i=0;i<x;i=i+3)
if(b[i]>max)
max=b[i];
for(i=0;i<x;i=i+3)
{
    if(b[i]==max)
    {
        y=i/3;
        if(c==0)
        {printf("%s",&name[y][0]);
        c++;}
        else
        printf(", %s",&name[y][0]);
    }
}
printf(".\n");
printf("If you want to order a pizza, you should call: ");
c=0;
max=b[1];
for(i=1;i<x;i=i+3)
if(b[i]>max)
max=b[i];
for(i=1;i<x;i=i+3)
{
    if(b[i]==max)
    {
        y=i/3;
        if(c==0)
        {printf("%s",&name[y][0]);
        c++;}
        else
        printf(", %s",&name[y][0]);
    }
}
printf(".\n");
c=0;
printf("If you want to go to a cafe with a wonderful girl, you should call: ");
max=b[2];
for(i=2;i<x;i=i+3)
if(b[i]>max)
max=b[i];
for(i=2;i<x;i=i+3)
{
    if(b[i]==max)
    {
        y=i/3;
        if(c==0)
        {printf("%s",&name[y][0]);
        c++;}
        else
        printf(" ,%s",&name[y][0]);
    }

}
printf(".\n");
return 0;
}


#include<stdio.h>
int main()
{
    int n,x=0,girl,taxi,pizza,c=0,y,i,num,max;
    scanf("%d",&n);
    char ch;
    char s[10];
    char name[n][25];
    int b[300]={0};
    for(i=0;i<n;i++)
    {
        scanf("%d",&num);
        scanf("%s",&name[i][0]);
        girl=0;taxi=0;pizza=0;
        while(num--)
        {
            scanf("%c",&ch);
            scanf("%s",&s);
            if(s[0]==s[1]&&s[1]==s[3]&&s[3]==s[4]&&s[4]==s[6]&&s[6]==s[7])
            taxi++;
            else if(s[0]>s[1]&&s[1]>s[3]&&s[3]>s[4]&&s[4]>s[6]&&s[6]>s[7])
            pizza++;
            else girl++;
        }
        b[x++]=taxi;
        b[x++]=pizza;
        b[x++]=girl;
    }
printf("If you want to call a taxi, you should call: ");

max=b[0];
for(i=0;i<x;i=i+3)
if(b[i]>max)
max=b[i];
for(i=0;i<x;i=i+3)
{
    if(b[i]==max)
    {
        y=i/3;
        if(c==0)
        {printf("%s",&name[y][0]);
        c++;}
        else
        printf(", %s",&name[y][0]);
    }
}
printf(".\n");
printf("If you want to order a pizza, you should call: ");
c=0;
max=b[1];
for(i=1;i<x;i=i+3)
if(b[i]>max)
max=b[i];
for(i=1;i<x;i=i+3)
{
    if(b[i]==max)
    {
        y=i/3;
        if(c==0)
        {printf("%s",&name[y][0]);
        c++;}
        else
        printf(", %s",&name[y][0]);
    }
}
printf(".\n");
c=0;
printf("If you want to go to a cafe with a wonderful girl, you should call: ");
max=b[2];
for(i=2;i<x;i=i+3)
if(b[i]>max)
max=b[i];
for(i=2;i<x;i=i+3)
{
    if(b[i]==max)
    {
        y=i/3;
        if(c==0)
        {printf("%s",&name[y][0]);
        c++;}
        else
        printf(", %s",&name[y][0]);
    }

}
printf(".\n");
return 0;
}


#include<stdio.h>
int main()
{
    int n,x=0,girl,taxi,pizza,c=0,y,i,num,max;
    scanf("%d",&n);
    char ch;
    char s[10];
    char name[n][25];
    int b[300]={0};
    for(i=0;i<n;i++)
    {
        scanf("%d",&num);
        scanf("%s",&name[i][0]);
        girl=0;taxi=0;pizza=0;
        while(num--)
        {
            scanf("%c",&ch);
            scanf("%s",&s);
            if(s[0]==s[1]&&s[1]==s[3]&&s[3]==s[4]&&s[4]==s[6]&&s[6]==s[7])
            taxi++;
            else if(s[0]>s[1]&&s[1]>s[3]&&s[3]>s[4]&&s[4]>s[6]&&s[6]>s[7])
            pizza++;
            else girl++;
        }
        b[x++]=taxi;
        b[x++]=pizza;
        b[x++]=girl;
    }
printf("If you want to call a taxi, you should call: ");

max=b[0];
for(i=0;i<x;i=i+3)
if(b[i]>max)
max=b[i];
for(i=0;i<x;i=i+3)
{
    if(b[i]==max)
    {
        y=i/3;
        if(c==0)
        {printf("%s",&name[y][0]);
        c++;}
        else
        printf(", %s",&name[y][0]);
    }
}
printf(".\n");
printf("If you want to order a pizza, you should call: ");
c=0;
max=b[1];
for(i=1;i<x;i=i+3)
if(b[i]>max)
max=b[i];
for(i=1;i<x;i=i+3)
{
    if(b[i]==max)
    {
        y=i/3;
        if(c==0)
        {printf("%s",&name[y][0]);
        c++;}
        else
        printf(", %s",&name[y][0]);
    }
}
printf(".\n");
c=0;
printf("If you want to go to a cafe with a wonderful girl, you should call: ");
max=b[2];
for(i=2;i<x;i=i+3)
if(b[i]>max)
max=b[i];
for(i=2;i<x;i=i+3)
{
    if(b[i]==max)
    {
        y=i/3;
        if(c==0)
        {printf("%s",&name[y][0]);
        c++;}
        else
        printf(" ,%s",&name[y][0]);
    }

}
printf(".\n");
return 0;
}


#include <stdio.h>
#include <ctype.h>
#include <string.h>

#define MAX_FRIENDS 100
#define MAX_NAME 101

void get_digits(char* phone)
{
  int i,j=0;
  for(i=0; phone[i]; i++)
    if (isdigit(phone[i]))
      phone[j++]=phone[i];

  phone[j]='\0';
}

char get_telephone(char* phone)
{
  int i;
  if (phone[0] == phone[1])
  {
     for(i=1; i<5; i++)
       if (phone[i] != phone[i+1])
	 return 'g';
     return 't';
  }
  if (phone[0] > phone[1])
  {
    for(i=1; i<5; i++)
      if (phone[i] <= phone[i+1])
	return 'g';
    return 'p';
  }
  return 'g';
}

int main()
{
  int n,i,j;
  scanf("%d",&n);

  char friends [MAX_FRIENDS][MAX_NAME];
  int girls[MAX_FRIENDS], taxi[MAX_FRIENDS], pizza[MAX_FRIENDS];
  int maxGirls = 0, maxPizza = 0, maxTaxi = 0;

  memset(girls,0,n*sizeof(int));
  memset(taxi,0,n*sizeof(int));
  memset(pizza,0,n*sizeof(int));

  for(i=0;i<n;i++)
  {
    int phonesNr;
    char telephone[15];
    scanf("%d%s",&phonesNr,friends[i]);

    for(j=0;j<phonesNr;j++)
    {
      scanf("%s",telephone);
      get_digits(telephone);

      switch (get_telephone(telephone))
      {
	case 'g': girls[i]++;
		   break;
	case 't': taxi[i]++;
		   break;
	case 'p': pizza[i]++;
		   break;
      }
    }

     if (girls[i] > maxGirls)
	maxGirls = girls[i];
      if (taxi[i] > maxTaxi)
	maxTaxi = taxi[i];
      if (pizza[i] > maxPizza)
	maxPizza = pizza[i];
  }

  //printf("DEBUG: maxGirls :%d maxPizza: %d maxTaxi: %d\n",maxGirls,maxPizza,maxTaxi);

  int counterGirls = 0, counterPizza = 0, counterTaxi =0;
  int indexGirls[MAX_FRIENDS], indexPizza[MAX_FRIENDS], indexTaxi[MAX_FRIENDS];
  for(i=0;i<n;i++)
  {
    if (taxi[i] == maxTaxi)
      indexTaxi[counterTaxi++] = i;
    if (girls[i] == maxGirls)
      indexGirls[counterGirls++] = i;
    if (pizza[i] == maxPizza)
      indexPizza[counterPizza++] = i;
  }

  //printf("counters: t%d g%d p%d\n",counterTaxi,counterGirls,counterPizza);

  printf("If you want to call a taxi, you should call: ");
  for(i=0; i<counterTaxi-1;i++)
   printf("%s, ",friends[indexTaxi[i]]);
  printf("%s.\n",friends[indexTaxi[counterTaxi-1]]);

  printf("If you want to order a pizza, you should call: ");
  for(i=0; i<counterPizza-1;i++)
   printf("%s, ",friends[indexPizza[i]]);
  printf("%s.\n",friends[indexPizza[counterPizza-1]]);

  printf("If you want to go to a cafe with a wonderful girl, you should call: ");
  for(i=0; i<counterGirls-1;i++)
   printf("%s, ",friends[indexGirls[i]]);
  printf("%s.\n",friends[indexGirls[counterGirls-1]]);

  return 0;
}


#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>

#define N 100
#define L 20

char name[N][L+2];
int pizza[N], taxi[N], girl[N];

int pizzanr(int *s) {
	int i;
	for (i=1; i<6; ++i) if (s[i]>=s[i-1]) return 0;
	return 1;
}

int taxinr(int *s) {
	int i;
	for (i=1; i<6; ++i) if (s[i]!=s[0]) return 0;
	return 1;
}

int girlnr(int *s) {
	return !pizzanr(s) && !taxinr(s);
}

void output(int n) {
	int i, m, nm, p;
	for (m=-1, i=nm=0; i<n; ++i) {
		if (taxi[i]==m) ++nm;
		else if (taxi[i]>m) {
			m=taxi[i];
			nm=1;
		}
	}
	printf("If you want to call a taxi, you should call: ");
	for (i=p=0; i<n; ++i) {
		if (taxi[i]==m) {
			printf("%s%s", name[i], ++p==nm?".\n":", ");
		}
	}
	for (m=-1, i=nm=0; i<n; ++i) {
		if (pizza[i]==m) ++nm;
		else if (pizza[i]>m) {
			m=pizza[i];
			nm=1;
		}
	}
	printf("If you want to order a pizza, you should call: ");
	for (i=p=0; i<n; ++i) {
		if (pizza[i]==m) {
			printf("%s%s", name[i], ++p==nm?".\n":", ");
		}
	}
	for (m=-1, i=nm=0; i<n; ++i) {
		if (girl[i]==m) ++nm;
		else if (girl[i]>m) {
			m=girl[i];
			nm=1;
		}
	}
	printf("If you want to go to a cafe with a wonderful girl, you should call: ");
	for (i=p=0; i<n; ++i) {
		if (girl[i]==m) {
			printf("%s%s", name[i], ++p==nm?".\n":", ");
		}
	}
}

int main(void) {
	int n, i;
	scanf("%d\n", &n);
	for (i=0; i<n; ++i) {
		int m, j;
		scanf("%d %s\n", &m, name[i]);
		for (j=0; j<m; ++j) {
			char nr[10], *s;
			int cnr[6], *u=cnr;
			fgets(nr, 10, stdin);
			for (s=nr; !isspace(*s); ++s) {
				if (isdigit(*s)) {
					*u++=*s;
				}
			}
			if (pizzanr(cnr)) ++pizza[i];
			else if (taxinr(cnr)) ++taxi[i];
			else ++girl[i];
		}
	}
	output(n);
	exit(EXIT_SUCCESS);
}


#include<stdio.h>
#include<string.h>
#include<ctype.h>
  int main() {
  int n, i, j, taxi[100] = {0}, piza[100] = {0}, girl[100] = {0}, p;
  int f1, f2, f3, k, l, m1, m2, m3, flag, len;
  char s[105][105], val[100];
  scanf("%d", &n);
  getchar();
  for(i = 0 ; i < n ; i++) {
      scanf("%d %s",&p, s[i]);
      getchar();
      for(j = 0 ; j < p ; j++) {
          scanf("%s",val);
          getchar();
          len = strlen(val);
          f1 = f2 = f3 = 0;
          for(k = 0 ; k < len ; k += 3) {
                  if(f1 != -1 && val[k] == val[k+1])
                      f1 = 1;
                  else if(f2 != -1 && f1 != 1 && val[k] > val[k+1]) {
                      f2 = 1;
                      f1 = -1;
                  }
                  else {
                      f3 = 1;
                      f1 = f2 = -1;
                  }
          }
         // printf("%d %d %d\n",f1,f2,f3);
          if(f1 == 1)
              ++taxi[i];
          if(f2 == 1)
              ++piza[i];
          if(f3 == 1)
              ++girl[i];
      }
     // printf("\n");
  }
  for(i = 0 ; i < n ; i++) {
      if(m1 < taxi[i])
           m1 = taxi[i];
      if(m2 < piza[i])
           m2 = piza[i];
      if(m3 < girl[i])
           m3 = girl[i];
  }

 printf("If you want to call a taxi, you should call:");
    flag=0;
    for(i = 0; i < n ; ++i)
    {
        if(m1 == taxi[i])
        {
            if(flag)
            {
                printf(",");
            }
            printf(" %s",s[i]);
            flag=1;
        }
    }
    printf(".\n");
    printf("If you want to order a pizza, you should call:");
    flag=0;
    for(i = 0 ; i < n ; ++i)
    {
        if(m2 == piza[i])
        {
            if(flag)
            {
                printf(",");
            }
            printf(" %s",s[i]);
            flag=1;
        }
    }
    printf(".\n");
    printf("If you want to go to a cafe with a wonderful girl, you should call:");
    flag=0;
    for(i = 0; i < n; ++i)
    {
        if(m3 == girl[i])
        {
            if(flag)
            {
                printf(",");
            }
            printf(" %s",s[i]);
            flag=1;
        }
    }
    printf(".\n");

  return 0;
  }


#include<stdio.h>
#include<string.h>
#include<ctype.h>
  int main() {
  int n, i, j, taxi[100] = {0}, piza[100] = {0}, girl[100] = {0}, p;
  int f1, f2, f3, k, l, m1, m2, m3, flag, len;
  char s[105][105], val[100];
  scanf("%d", &n);
  getchar();
  for(i = 0 ; i < n ; i++) {
      scanf("%d %s",&p, s[i]);
      getchar();
      for(j = 0 ; j < p ; j++) {
          scanf("%s",val);
          getchar();
          len = strlen(val);
          f1 = f2 = f3 = 0;
          for(k = 0 , l = k+1; k < len - 1; l++, k++) {
                  if(!isdigit(val[k]))
                      k++;
                  if(!isdigit(val[l]))
                      l++;
                  if(f1 != -1 && val[k] == val[l])
                      f1 = 1;
                  else if(f2 != -1 && f1 != 1 && f3 != 1 && val[k] > val[l]) {
                      f2 = 1;
                      f1 = -1;
                  }
                  else {
                      f3 = 1;
                      f1 = f2 = -1;
                  }
          }
          printf("%d %d %d\n",f1,f2,f3);
          if(f1 == 1)
              ++taxi[i];
          if(f2 == 1)
              ++piza[i];
          if(f3 == 1)
              ++girl[i];
      }
      printf("\n");
  }
  for(i = 0 ; i < n ; i++) {
      if(m1 < taxi[i])
           m1 = taxi[i];
      if(m2 < piza[i])
           m2 = piza[i];
      if(m3 < girl[i])
           m3 = girl[i];
  }
printf("%d %d %d\n", m1,m2,m3);
 printf("If you want to call a taxi, you should call:");
    flag=0;
    for(i = 0; i < n ; ++i)
    {
        if(m1 == taxi[i])
        {
            if(flag)
            {
                printf(",");
            }
            printf(" %s",s[i]);
            flag=1;
        }
    }
    printf(".\n");
    printf("If you want to order a pizza, you should call:");
    flag=0;
    for(i = 0 ; i < n ; ++i)
    {
        if(m2 == piza[i])
        {
            if(flag)
            {
                printf(",");
            }
            printf(" %s",s[i]);
            flag=1;
        }
    }
    printf(".\n");
    printf("If you want to go to a cafe with a wonderful girl, you should call:");
    flag=0;
    for(i = 0; i < n; ++i)
    {
        if(m3 == girl[i])
        {
            if(flag)
            {
                printf(",");
            }
            printf(" %s",s[i]);
            flag=1;
        }
    }
    printf(".\n");

  return 0;
  }


#include<stdio.h>
#include<string.h>
#include<ctype.h>
  int main() {
  int n, i, j, taxi[100] = {0}, piza[100] = {0}, girl[100] = {0}, p;
  int f1, f2, f3, k, l, m1, m2, m3, flag, len;
  char s[105][105], val[100];
  scanf("%d", &n);
  getchar();
  for(i = 0 ; i < n ; i++) {
      scanf("%d %s",&p, s[i]);
      getchar();
      for(j = 0 ; j < p ; j++) {
          scanf("%s",val);
          getchar();
          len = strlen(val);
          f1 = f2 = f3 = 0;
          for(k = 0 , l = k+1; k < len - 1; l++, k++) {
                  if(!isdigit(val[k]))
                      k++;
                  if(!isdigit(val[l]))
                      l++;
                  if(f1 != -1 && val[k] == val[l])
                      f1 = 1;
                  else if(f2 != -1 && f1 != 1 && f3 != 1 && val[k] > val[l]) {
                      f2 = 1;
                      f1 = -1;
                  }
                  else {
                      f3 = 1;
                      f1 = f2 = -1;
                  }
          }
         // printf("%d %d %d\n",f1,f2,f3);
          if(f1 == 1)
              ++taxi[i];
          if(f2 == 1)
              ++piza[i];
          if(f3 == 1)
              ++girl[i];
      }
    //  printf("\n");
  }
  for(i = 0 ; i < n ; i++) {
      if(m1 < taxi[i])
           m1 = taxi[i];
      if(m2 < piza[i])
           m2 = piza[i];
      if(m3 < girl[i])
           m3 = girl[i];
  }
printf("%d %d %d\n", m1,m2,m3);
 printf("If you want to call a taxi, you should call:");
    flag=0;
    for(i = 0; i < n ; ++i)
    {
        if(m1 == taxi[i])
        {
            if(flag)
            {
                printf(",");
            }
            printf(" %s",s[i]);
            flag=1;
        }
    }
    printf(".\n");
    printf("If you want to order a pizza, you should call:");
    flag=0;
    for(i = 0 ; i < n ; ++i)
    {
        if(m2 == piza[i])
        {
            if(flag)
            {
                printf(",");
            }
            printf(" %s",s[i]);
            flag=1;
        }
    }
    printf(".\n");
    printf("If you want to go to a cafe with a wonderful girl, you should call:");
    flag=0;
    for(i = 0; i < n; ++i)
    {
        if(m3 == girl[i])
        {
            if(flag)
            {
                printf(",");
            }
            printf(" %s",s[i]);
            flag=1;
        }
    }
    printf(".\n");

  return 0;
  }


#include<stdio.h>
#include<string.h>
#include<ctype.h>
  int main() {
  int n, i, j, taxi[100] = {0}, piza[100] = {0}, girl[100] = {0}, p;
  int f1, f2, f3, k, l, m1, m2, m3, flag, len;
  char s[105][105], val[100];
  scanf("%d", &n);
  getchar();
  for(i = 0 ; i < n ; i++) {
      scanf("%d %s",&p, s[i]);
      getchar();
      for(j = 0 ; j < p ; j++) {
          scanf("%s",val);
          getchar();
          len = strlen(val);
          f1 = f2 = f3 = 0;
          for(k = 0 ; k < len ; k += 3) {
                  if(f1 != -1 && val[k] == val[k+1])
                      f1 = 1;
                  else if(f2 != -1 && f1 != 1 && val[k] > val[k+1]) {
                      f2 = 1;
                      f1 = -1;
                  }
                  else {
                      f3 = 1;
                      f1 = f2 = -1;
                  }
          }
         // printf("%d %d %d\n",f1,f2,f3);
          if(f1 == 1)
              ++taxi[i];
          if(f2 == 1)
              ++piza[i];
          if(f3 == 1)
              ++girl[i];
      }
      printf("\n");
  }
  for(i = 0 ; i < n ; i++) {
      if(m1 < taxi[i])
           m1 = taxi[i];
      if(m2 < piza[i])
           m2 = piza[i];
      if(m3 < girl[i])
           m3 = girl[i];
  }

 printf("If you want to call a taxi, you should call:");
    flag=0;
    for(i = 0; i < n ; ++i)
    {
        if(m1 == taxi[i])
        {
            if(flag)
            {
                printf(",");
            }
            printf(" %s",s[i]);
            flag=1;
        }
    }
    printf(".\n");
    printf("If you want to order a pizza, you should call:");
    flag=0;
    for(i = 0 ; i < n ; ++i)
    {
        if(m2 == piza[i])
        {
            if(flag)
            {
                printf(",");
            }
            printf(" %s",s[i]);
            flag=1;
        }
    }
    printf(".\n");
    printf("If you want to go to a cafe with a wonderful girl, you should call:");
    flag=0;
    for(i = 0; i < n; ++i)
    {
        if(m3 == girl[i])
        {
            if(flag)
            {
                printf(",");
            }
            printf(" %s",s[i]);
            flag=1;
        }
    }
    printf(".\n");

  return 0;
  }


#include<stdio.h>
#include<string.h>
#include<ctype.h>
  int main() {
  int n, i, j, taxi[100] = {0}, piza[100] = {0}, girl[100] = {0}, p;
  int f1, f2, f3, k, l, m1, m2, m3, flag, len;
  char s[105][105], val[100];
  scanf("%d", &n);
  getchar();
  for(i = 0 ; i < n ; i++) {
      scanf("%d %s",&p, s[i]);
      getchar();
      for(j = 0 ; j < p ; j++) {
          scanf("%s",val);
          getchar();
          len = strlen(val);
          f1 = f2 = f3 = 0;
          for(k = 0 , l = k+1; k < len - 1; l++, k++) {
                  if(!isdigit(val[k]))
                      k++;
                  if(!isdigit(val[l]))
                      l++;
                  if(f1 != -1 && val[k] == val[l])
                      f1 = 1;
                  else if(f2 != -1 && f1 != 1 && f3 != 1 && val[k] > val[l]) {
                      f2 = 1;
                      f1 = -1;
                  }
                  else {
                      f3 = 1;
                      f1 = f2 = -1;
                  }
          }
         // printf("%d %d %d\n",f1,f2,f3);
          if(f1 == 1)
              ++taxi[i];
          if(f2 == 1)
              ++piza[i];
          if(f3 == 1)
              ++girl[i];
      }
    //  printf("\n");
  }
  for(i = 0 ; i < n ; i++) {
      if(m1 < taxi[i])
           m1 = taxi[i];
      if(m2 < piza[i])
           m2 = piza[i];
      if(m3 < girl[i])
           m3 = girl[i];
  }
//printf("%d %d %d\n", m1,m2,m3);
 printf("If you want to call a taxi, you should call:");
    flag=0;
    for(i = 0; i < n ; ++i)
    {
        if(m1 == taxi[i])
        {
            if(flag)
            {
                printf(",");
            }
            printf(" %s",s[i]);
            flag=1;
        }
    }
    printf(".\n");
    printf("If you want to order a pizza, you should call:");
    flag=0;
    for(i = 0 ; i < n ; ++i)
    {
        if(m2 == piza[i])
        {
            if(flag)
            {
                printf(",");
            }
            printf(" %s",s[i]);
            flag=1;
        }
    }
    printf(".\n");
    printf("If you want to go to a cafe with a wonderful girl, you should call:");
    flag=0;
    for(i = 0; i < n; ++i)
    {
        if(m3 == girl[i])
        {
            if(flag)
            {
                printf(",");
            }
            printf(" %s",s[i]);
            flag=1;
        }
    }
    printf(".\n");

  return 0;
  }


#include<stdio.h>
#include<string.h>
#include<ctype.h>
  int main() {
  int n, i, j, taxi[100] = {0}, piza[100] = {0}, girl[100] = {0}, p;
  int f1, f2, f3, k, l, m1, m2, m3, flag, len;
  char s[105][105], val[100];
  scanf("%d", &n);
  getchar();
  for(i = 0 ; i < n ; i++) {
      scanf("%d %s",&p, s[i]);
      getchar();
      for(j = 0 ; j < p ; j++) {
          scanf("%s",val);
          getchar();
          f1 = f2 = f3 = 1;
          len = strlen(val);
          for(k = 0 ; k < len ; k += 3){
                  if(f1 && val[k] == val[k+1])
                      continue;
                  else if(f2 && val[k] > val[k+1])
                      f1 = 0;
                  else
                      f2 = 0;
              }
          if(f1)
              ++taxi[i];
          else if(f2)
              ++piza[i];
          else
              ++girl[i];
      }
  }
  for(i = 0 ; i < n ; i++) {
      if(m1 < taxi[i])
           m1 = taxi[i];
      if(m2 < piza[i])
           m2 = piza[i];
      if(m3 < girl[i])
           m3 = girl[i];
  }

 printf("If you want to call a taxi, you should call:");
    flag=0;
    for(i = 0; i < n ; ++i)
    {
        if(m1 == taxi[i])
        {
            if(flag)
            {
                printf(",");
            }
            printf(" %s",s[i]);
            flag=1;
        }
    }
    printf(".\n");
    printf("If you want to order a pizza, you should call:");
    flag=0;
    for(i = 0 ; i < n ; ++i)
    {
        if(m2 == piza[i])
        {
            if(flag)
            {
                printf(",");
            }
            printf(" %s",s[i]);
            flag=1;
        }
    }
    printf(".\n");
    printf("If you want to go to a cafe with a wonderful girl, you should call:");
    flag=0;
    for(i = 0; i < n; ++i)
    {
        if(m3 == girl[i])
        {
            if(flag)
            {
                printf(",");
            }
            printf(" %s",s[i]);
            flag=1;
        }
    }
    printf(".\n");

  return 0;
  }


#include <stdio.h>
#include <string.h>

int main() {
	int n;
	scanf("%d", &n);

	int i;
	char names[100][30];
	int c[100][3];
	memset(c, 0, sizeof(c));
	for (i = 0; i < n; i++) {
		int k;
		scanf("%d%s\n", &k, names[i]);

		int j;
		for (j = 0; j < k; j++) {
			char s[100];
			gets(s);
			strcpy(s + 2, s + 3);
			strcpy(s + 4, s + 5);
			// puts(s);

			int ii;
			for (ii = 1; ii < 6; ii++)
				if (s[ii] != s[ii-1])
					break;

			if (ii == 6) {
				c[i][0]++;
				continue;
			}

			for (ii = 1; ii < 6; ii++)
				if (s[ii] >= s[ii-1])
					break;

			if (ii == 6) {
				c[i][1]++;
				continue;
			}

			c[i][2]++;
		}
	}

	int m[3];
	memset(m, 0, sizeof(m));
	int j;
	for (i = 0; i < n; i++)
		for (j = 0; j < 3; j++) {
			// printf("i = %d j = %d c = %d\n", i+1, j+1, c[i][j]);
			if (c[i][j] > m[j])
				m[j] = c[i][j];
		}

	for (j = 0; j < 3; j++) {
		if (j == 0)
			printf("If you want to call a taxi, you should call:");
		else if (j == 1)
			printf("If you want to order a pizza, you should call:");
		else
			printf("If you want to go to a cafe with a wonderful girl, you should call:");

		int f = 1;
		for (i = 0; i < n; i++)
			if (m[j] == c[i][j])
				if (f) {
					printf(" %s", names[i]);
					f = 0;
				} else
					printf(", %s", names[i]);
		puts(".");
	}

	return 0;
}


#include<stdio.h>
int main()
{
int n,i,j,maxtaxi=0,maxpizza=0,maxgirl=0;
scanf("%d",&n);
int s[n],taxi[100]={0},girl[100]={0},pizza[100]={0};
char c[n][100];
for(i=0;i<n;i++)
{scanf("%d %s",&s[i],c[i]);
char p[s[i]][10];
for(j=0;j<s[i];j++)
{scanf("%s",p[j]);
if(p[j][0]==p[j][1]&&p[j][1]==p[j][3]&&p[j][3]==p[j][4]&&p[j][4]==p[j][6]&&p[j][6]==p[j][7])
taxi[i]++;
else if(p[j][1]<p[j][0]&&p[j][3]<p[j][1]&&p[j][4]<p[j][3]&&p[j][6]<p[j][4]&&p[j][7]<p[j][6])
pizza[i]++;
else
girl[i]++;
}
if(taxi[i]>=maxtaxi)
maxtaxi=taxi[i];
if(pizza[i]>=maxpizza)
maxpizza=pizza[i];
if(girl[i]>=maxgirl)
maxgirl=girl[i];}
printf("If you want to call a taxi, you should call:");
for(i=0;i<n;i++)
{if(taxi[i]==maxtaxi)
printf("%s ",c[i]);}
printf("\n");
printf("If you want to order a pizza, you should call:");
for(i=0;i<n;i++)
{if(pizza[i]==maxpizza)
printf("%s ",c[i]);}
printf("\n");
printf("If you want to go to a cafe with a wonderful girl, you should call:");
for(i=0;i<n;i++)
{if(girl[i]==maxgirl)
printf("%s ",c[i]);}
return(0);}


#include<stdio.h>
int main()
{
int n,i,j,maxtaxi=0,maxpizza=0,maxgirl=0,l1=0,l2=0,l3=0;
scanf("%d",&n);
int s[n],taxi[100]={0},girl[100]={0},pizza[100]={0};
char c[n][100];
for(i=0;i<n;i++)
{scanf("%d %s",&s[i],c[i]);
char p[s[i]][10];
for(j=0;j<s[i];j++)
{scanf("%s",p[j]);
if(p[j][0]==p[j][1]&&p[j][1]==p[j][3]&&p[j][3]==p[j][4]&&p[j][4]==p[j][6]&&p[j][6]==p[j][7])
taxi[i]++;
else if(p[j][1]<p[j][0]&&p[j][3]<p[j][1]&&p[j][4]<p[j][3]&&p[j][6]<p[j][4]&&p[j][7]<p[j][6])
pizza[i]++;
else
girl[i]++;
}
if(taxi[i]>=maxtaxi)
maxtaxi=taxi[i];
if(pizza[i]>=maxpizza)
maxpizza=pizza[i];
if(girl[i]>=maxgirl)
maxgirl=girl[i];}
for(i=0;i<n;i++)
{if(taxi[i]==maxtaxi)
l1++;
if(pizza[i]==maxpizza)
l2++;
if(girl[i]==maxgirl)
l3++;}
int z=0;
printf("If you want to call a taxi, you should call: ");
for(i=0;i<n;i++)
{if(taxi[i]==maxtaxi)
{printf("%s",c[i]);
z++;
if(z<=l1-1)
printf(", ");
else
{printf(".");
break;}}
}
printf("\n");
z=0;
printf("If you want to order a pizza, you should call: ");
for(i=0;i<n;i++)
{if(pizza[i]==maxpizza)
{printf("%s",c[i]);
z++;
if(z<=l2-1)
printf(", ");
else
{printf(".");
break;}}
}
printf("\n");
z=0;
printf("If you want to go to a cafe with a wonderful girl, you should call: ");
for(i=0;i<n;i++)
{if(girl[i]==maxgirl)
{printf("%s ",c[i]);
z++;
if(z<=l3-1)
printf(", ");
else
{printf(".");
break;}}}
return(0);}


#include<stdio.h>
int main()
{
int n,i,j,maxtaxi=0,maxpizza=0,maxgirl=0,l1=0,l2=0,l3=0;
scanf("%d",&n);
int s[n],taxi[100]={0},girl[100]={0},pizza[100]={0};
char c[n][100];
for(i=0;i<n;i++)
{scanf("%d %s",&s[i],c[i]);
char p[s[i]][10];
for(j=0;j<s[i];j++)
{scanf("%s",p[j]);
if(p[j][0]==p[j][1]&&p[j][1]==p[j][3]&&p[j][3]==p[j][4]&&p[j][4]==p[j][6]&&p[j][6]==p[j][7])
taxi[i]++;
else if(p[j][1]<p[j][0]&&p[j][3]<p[j][1]&&p[j][4]<p[j][3]&&p[j][6]<p[j][4]&&p[j][7]<p[j][6])
pizza[i]++;
else
girl[i]++;
}
if(taxi[i]>=maxtaxi)
maxtaxi=taxi[i];
if(pizza[i]>=maxpizza)
maxpizza=pizza[i];
if(girl[i]>=maxgirl)
maxgirl=girl[i];}
for(i=0;i<n;i++)
{if(taxi[i]==maxtaxi)
l1++;
if(pizza[i]==maxpizza)
l2++;
if(girl[i]==maxgirl)
l3++;}
int z=0;
printf("If you want to call a taxi, you should call: ");
for(i=0;i<n;i++)
{if(taxi[i]==maxtaxi)
{printf("%s",c[i]);
z++;}
if(z<=l1-1)
printf(", ");
else
{printf(".");
break;}
}
printf("\n");
z=0;
printf("If you want to order a pizza, you should call: ");
for(i=0;i<n;i++)
{if(pizza[i]==maxpizza)
{printf("%s",c[i]);
z++;}
if(z<=l2-1)
printf(", ");
else
{printf(".");
break;}
}
printf("\n");
z=0;
printf("If you want to go to a cafe with a wonderful girl, you should call: ");
for(i=0;i<n;i++)
{if(girl[i]==maxgirl)
{printf("%s ",c[i]);
z++;}
if(z<=l3-1)
printf(", ");
else
{printf(".");
break;}}
return(0);}


#include<stdio.h>
int main()
{
int n,i,j,maxtaxi=0,maxpizza=0,maxgirl=0,l1=0,l2=0,l3=0;
scanf("%d",&n);
int s[n],taxi[100]={0},girl[100]={0},pizza[100]={0};
char c[n][100];
for(i=0;i<n;i++)
{scanf("%d %s",&s[i],c[i]);
char p[s[i]][10];
for(j=0;j<s[i];j++)
{scanf("%s",p[j]);
if(p[j][0]==p[j][1]&&p[j][1]==p[j][3]&&p[j][3]==p[j][4]&&p[j][4]==p[j][6]&&p[j][6]==p[j][7])
taxi[i]++;
else if(p[j][1]<p[j][0]&&p[j][3]<p[j][1]&&p[j][4]<p[j][3]&&p[j][6]<p[j][4]&&p[j][7]<p[j][6])
pizza[i]++;
else
girl[i]++;
}
if(taxi[i]>=maxtaxi)
maxtaxi=taxi[i];
if(pizza[i]>=maxpizza)
maxpizza=pizza[i];
if(girl[i]>=maxgirl)
maxgirl=girl[i];}
for(i=0;i<n;i++)
{if(taxi[i]==maxtaxi)
l1++;
if(pizza[i]==maxpizza)
l2++;
if(girl[i]==maxgirl)
l3++;}
int z=0;
printf("If you want to call a taxi, you should call: ");
for(i=0;i<n;i++)
{if(taxi[i]==maxtaxi)
{printf("%s",c[i]);
z++;
if(z<=l1-1)
printf(", ");
else
{printf(".");
break;}}
}
printf("\n");
z=0;
printf("If you want to order a pizza, you should call: ");
for(i=0;i<n;i++)
{if(pizza[i]==maxpizza)
{printf("%s",c[i]);
z++;
if(z<=l2-1)
printf(", ");
else
{printf(".");
break;}}
}
printf("\n");
z=0;
printf("If you want to go to a cafe with a wonderful girl, you should call: ");
for(i=0;i<n;i++)
{if(girl[i]==maxgirl)
{printf("%s",c[i]);
z++;
if(z<=l3-1)
printf(", ");
else
{printf(".");
break;}}}
return(0);}


#include<bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define pi 3.1415926535897
#define ll long long int
#define ld long double
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define mod 1000000007
#define mod1 998244353
#define inf 1000000000000000000
#define inf1 1000000000
#define endl '\n'
int main()
{
	fastio;
	#ifdef APNA_IO
		freopen("input.txt" , "rt" ,stdin);
		freopen("output.txt" , "wt" ,stdout);
	#endif
	ll t;
	cin>>t;
	while(t--)
	{
		ll a,b;
		cin>>a>>b;
		if(b==0)
			cout<<1<<endl;
		else if(a<=4*b)
		{
			ld ans;
			ans=a*1.0;
			ans=ans/b;
			ans=ans/16;
			ans+=0.5;
			cout<<std::setprecision(10)<<ans<<endl;
		}
		else
		{
			ld ans=(a-b)*1.0;
			ans/=b;
			cout<<std::setprecision(10)<<ans<<endl;
		}
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define pi 3.1415926535897
#define ll long long int
#define ld long double
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define mod 1000000007
#define mod1 998244353
#define inf 1000000000000000000
#define inf1 1000000000
#define endl '\n'
int main()
{
	fastio;
	#ifdef APNA_IO
		freopen("input.txt" , "rt" ,stdin);
		freopen("output.txt" , "wt" ,stdout);
	#endif
	ll t;
	cin>>t;
	while(t--)
	{
		ll a,b;
		cin>>a>>b;
		if(b==0)
			cout<<1<<endl;
		else if(a<=4*b)
		{
			ld ans;
			ans=a*1.0;
			ans=ans/b;
			ans=ans/16;
			ans+=0.5;
			cout<<std::setprecision(10)<<ans<<endl;
		}
		else
		{
			ld ans=(a-b)*1.0;
			ans/=a;
			cout<<std::setprecision(10)<<ans<<endl;
		}
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define clr(i, j)     memset(i, j, sizeof(i))
#define mp(i, j)      make_pair(i, j)
#define pb(i)         push_back(i)
typedef long long     ll;
typedef long double   ld;

int main()
{
    int t;
    cin >> t;
    while(t--)
    {
        double a, b;
        cin >> a >> b;
        if(b == 0)
        {
            cout << fixed << setprecision(10) << 1 << endl;
            continue;
        }
        else if(a == 0)
        {
            cout << fixed << setprecision(10) << .5 << endl;
        }
        double interA[2];
        interA[0] = 0;
        interA[1] = min(b*4, a);
        double midA = (interA[0]+interA[1])/2;
        double p_of_midA = (midA/4+b)/(b*2);
        double S_of_interB = a-interA[1];
        double ans = (p_of_midA*interA[1] + S_of_interB)/(S_of_interB+interA[1]);
        cout << fixed << setprecision(10) << ans << endl;
    }
}


#include <bits/stdc++.h>
using namespace std;

#define clr(i, j)     memset(i, j, sizeof(i))
#define mp(i, j)      make_pair(i, j)
#define pb(i)         push_back(i)
typedef long long     ll;
typedef long double   ld;

int main()
{
    int t;
    cin >> t;
    while(t--)
    {
        double a, b;
        cin >> a >> b;
        double triA = a/b;
        double interB = b*2;
        double ans = (triA/4 + b)/interB;
        cout << fixed << setprecision(10) << ans << endl;
    }
}


#include <bits/stdc++.h>
using namespace std;

#define clr(i, j)     memset(i, j, sizeof(i))
#define mp(i, j)      make_pair(i, j)
#define pb(i)         push_back(i)
typedef long long     ll;
typedef long double   ld;

int main()
{
    int t;
    cin >> t;
    while(t--)
    {
        double a, b;
        cin >> a >> b;
        double triA = a/2;
        double interB = b*2;
        double ans = (triA/4 + b)/interB;
        cout << fixed << setprecision(10) << ans << endl;
    }
}


#include <bits/stdc++.h>
using namespace std;

#define clr(i, j)     memset(i, j, sizeof(i))
#define mp(i, j)      make_pair(i, j)
#define pb(i)         push_back(i)
typedef long long     ll;
typedef long double   ld;

int main()
{
    int t;
    cin >> t;
    while(t--)
    {
        double a, b;
        cin >> a >> b;
        if(b == 0)
        {
            cout << fixed << setprecision(10) << 1 << endl;
            continue;
        }
        else if(a == 0)
        {
            cout << fixed << setprecision(10) << .5 << endl;
            continue;
        }
        double interA[2];
        interA[0] = 0;
        interA[1] = min(b*4, a);
        double midA = (interA[0]+interA[1])/2;
        double p_of_midA = (midA/4+b)/(b*2);
        double S_of_interB = a-interA[1];
        double ans = (p_of_midA*interA[1] + S_of_interB)/(S_of_interB+interA[1]);
        cout << fixed << setprecision(10) << ans << endl;
    }
}


#include <bits/stdc++.h>
using namespace std;

#define clr(i, j)     memset(i, j, sizeof(i))
#define mp(i, j)      make_pair(i, j)
#define pb(i)         push_back(i)
typedef long long     ll;
typedef long double   ld;

int main()
{
    int t;
    cin >> t;
    while(t--)
    {
        double a, b;
        cin >> a >> b;
        double interA[2];
        interA[0] = 0;
        interA[1] = min(b*4, a);
        double midA = (interA[0]+interA[1])/2;
        double p_of_midA = (midA/4+b)/(b*2);
        double S_of_interB = a-interA[1];
        double ans = (p_of_midA*interA[1] + S_of_interB)/(S_of_interB+interA[1]);
        cout << fixed << setprecision(10) << ans << endl;
    }
}


#include <bits/stdc++.h>
using namespace std;

#define clr(i, j)     memset(i, j, sizeof(i))
#define mp(i, j)      make_pair(i, j)
#define pb(i)         push_back(i)
typedef long long     ll;
typedef long double   ld;

int main()
{
    int t;
    cin >> t;
    while(t--)
    {
        double a, b;
        cin >> a >> b;
        if(b == 0)
        {
            cout << fixed << setprecision(10) << 1 << endl;
            continue;
        }
        if(a == 0)
        {
            cout << fixed << setprecision(10) << .5 << endl;
        }
        double interA[2];
        interA[0] = 0;
        interA[1] = min(b*4, a);
        double midA = (interA[0]+interA[1])/2;
        double p_of_midA = (midA/4+b)/(b*2);
        double S_of_interB = a-interA[1];
        double ans = (p_of_midA*interA[1] + S_of_interB)/(S_of_interB+interA[1]);
        cout << fixed << setprecision(10) << ans << endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define int long long
#define all(sdk) sdk.begin(),sdk.end()
#define mll map<int, int>
#define pb push_back
#define rep(i,a,b) for(int i=a;i<b;++i)
#define repd(i,a,b) for(int i=a;i>=b;--i)
#define mp make_pair
#define hell 1000000007
#define endl '\n'
#define vvll vector<vector<int> >
#define vll vector<int>
#define mint map<int,int>
#define sz(x) (int)x.size()
#define sll set<int>
#define pll pair<int,int>
#define F first
#define S second

void solve(){
	int a,b;
	cin>>a>>b;
	double area = 2.0*b*a;
	if(a*b==0){
		if(a==0 and b==0){
			cout<<1<<endl;
		}
		else if(a==0){
			cout<<0.5<<endl;
		}
		else{
			cout<<1<<endl;
		}
		return;
	}
	if(a<4*b){
		cout<<((1.0/8)*a*a+a*b)/area<<endl;
	}
	else{
		cout<<(area-2*b*b)/area<<endl;
	}
}

signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    cin>>t;
    cout<<fixed<<setprecision(12);
    while(t--){
        solve();
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define int long long
#define all(sdk) sdk.begin(),sdk.end()
#define mll map<int, int>
#define pb push_back
#define rep(i,a,b) for(int i=a;i<b;++i)
#define repd(i,a,b) for(int i=a;i>=b;--i)
#define mp make_pair
#define hell 1000000007
#define endl '\n'
#define vvll vector<vector<int> >
#define vll vector<int>
#define mint map<int,int>
#define sz(x) (int)x.size()
#define sll set<int>
#define pll pair<int,int>
#define F first
#define S second

void solve(){
	int a,b;
	cin>>a>>b;
	double area = 2.0*b*a;
	if(a*b==0){
		if(a==0 and b==0){
			cout<<1<<endl;
		}
		else if(a==0){
			cout<<0<<endl;
		}
		else{
			cout<<1<<endl;
		}
	}
	if(a<4*b){
		cout<<((1.0/8)*a*a+a*b)/area<<endl;
	}
	else{
		cout<<(area-2*b*b)/area<<endl;
	}
}

signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    cin>>t;
    cout<<fixed<<setprecision(12);
    while(t--){
        solve();
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define int long long
#define all(sdk) sdk.begin(),sdk.end()
#define mll map<int, int>
#define pb push_back
#define rep(i,a,b) for(int i=a;i<b;++i)
#define repd(i,a,b) for(int i=a;i>=b;--i)
#define mp make_pair
#define hell 1000000007
#define endl '\n'
#define vvll vector<vector<int> >
#define vll vector<int>
#define mint map<int,int>
#define sz(x) (int)x.size()
#define sll set<int>
#define pll pair<int,int>
#define F first
#define S second

void solve(){
	int a,b;
	cin>>a>>b;
	double area = 2.0*b*a;
	if(a*b==0){
		if(a==0 and b==0){
			cout<<1<<endl;
		}
		else if(a==0){
			cout<<0<<endl;
		}
		else{
			cout<<1<<endl;
		}
		return;
	}
	if(a<4*b){
		cout<<((1.0/8)*a*a+a*b)/area<<endl;
	}
	else{
		cout<<(area-2*b*b)/area<<endl;
	}
}

signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    cin>>t;
    cout<<fixed<<setprecision(12);
    while(t--){
        solve();
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define int long long
#define all(sdk) sdk.begin(),sdk.end()
#define mll map<int, int>
#define pb push_back
#define rep(i,a,b) for(int i=a;i<b;++i)
#define repd(i,a,b) for(int i=a;i>=b;--i)
#define mp make_pair
#define hell 1000000007
#define endl '\n'
#define vvll vector<vector<int> >
#define vll vector<int>
#define mint map<int,int>
#define sz(x) (int)x.size()
#define sll set<int>
#define pll pair<int,int>
#define F first
#define S second

void solve(){
	int a,b;
	cin>>a>>b;
	double area = 2.0*b*a;
	if(a<4*b){
		cout<<((1.0/8)*a*a+a*b)/area<<endl;
	}
	else{
		cout<<(area-2*b*b)/area<<endl;
	}
}

signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    cin>>t;
    cout<<fixed<<setprecision(12);
    while(t--){
        solve();
    }
    return 0;
}


///****In the name of Allah, most Gracious, most Compassionate****//

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair <int, int> pii;

#define ALL(a) a.begin(), a.end()
#define FastIO ios::sync_with_stdio(false); cin.tie(nullptr);cout.tie(nullptr)
#define IN freopen("input.txt","r+",stdin)
#define OUT freopen("output.txt","w+",stdout)

#define DBG(a) cout<< #a <<" --> "<<(a)<<endl
#define NL cout<<"\n"

template < class T1,class T2>
ostream &operator <<(ostream &os,const pair < T1,T2 > &p)
{
    os<<"{"<<p.first<<","<<p.second<<"}";
    return os;
}

const int N=3e5+5;
const int oo=1e9+7;

int32_t main()
{
    FastIO;
    int T,cs=0;
    cin>>T;
    while(T--)
    {
        double a,b;
        ll aa, bb;
        cin>>aa>>bb;
        a=aa;
        b=bb;
        double mn=  min(a/4.0, b);
        double h= a-mn*4;
        double ans = a*b + h*mn + mn* (a-h) - mn*(a-h)/2.0;
        if(aa)
            ans/=a;
        if(bb)
            ans/=b;
        ans/=2.0;
        if(aa==0 or bb==0)
            ans = aa or ( !aa and !bb)  ? 1.0 : 0.5;
        cout<<setprecision(10)<<ans<<"\n";
    }
}


///****In the name of Allah, most Gracious, most Compassionate****//

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair <int, int> pii;

#define ALL(a) a.begin(), a.end()
#define FastIO ios::sync_with_stdio(false); cin.tie(nullptr);cout.tie(nullptr)
#define IN freopen("input.txt","r+",stdin)
#define OUT freopen("output.txt","w+",stdout)

#define DBG(a) cout<< #a <<" --> "<<(a)<<endl
#define NL cout<<"\n"

template < class T1,class T2>
ostream &operator <<(ostream &os,const pair < T1,T2 > &p)
{
    os<<"{"<<p.first<<","<<p.second<<"}";
    return os;
}

const int N=3e5+5;
const int oo=1e9+7;

int32_t main()
{
    FastIO;
    int T,cs=0;
    cin>>T;
    while(T--)
    {
        double a,b;
        ll aa  , bb;
        cin>>aa>>bb;
        a=aa;
        b=bb;
        double mn=  min(a/4.0 , b);
        double h= a-mn*4;
        double ans = a*b + h*mn + mn* (a-h) - mn*(a-h)/2.0;
        if(aa)
        ans/=a;
        if(bb)
        ans/=b;
        ans/=2.0;
        if(aa==0 or bb==0) ans = aa or ( !aa and !bb);
        cout<<setprecision(10)<<ans<<"\n";
    }
}


///****In the name of Allah, most Gracious, most Compassionate****//

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair <int, int> pii;

#define ALL(a) a.begin(), a.end()
#define FastIO ios::sync_with_stdio(false); cin.tie(nullptr);cout.tie(nullptr)
#define IN freopen("input.txt","r+",stdin)
#define OUT freopen("output.txt","w+",stdout)

#define DBG(a) cout<< #a <<" --> "<<(a)<<endl
#define NL cout<<"\n"

template < class T1,class T2>
ostream &operator <<(ostream &os,const pair < T1,T2 > &p)
{
    os<<"{"<<p.first<<","<<p.second<<"}";
    return os;
}

const int N=3e5+5;
const int oo=1e9+7;

int32_t main()
{
    FastIO;
    int T,cs=0;
    cin>>T;
    while(T--)
    {
        double a,b;
        ll aa  , bb;
        cin>>aa>>bb;
        a=aa;
        b=bb;
        double mn=  min(a/4.0 , b);
        double h= a-mn*4;
        double ans = a*b + h*mn + mn* (a-h) - mn*(a-h)/2.0;
        ans/=a;
        ans/=b;
        ans/=2.0;
        if(aa==0 or bb==0) ans = aa or ( !aa and !bb);
        cout<<setprecision(10)<<ans<<"\n";
    }
}


#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define read(type) readInt<type>()
#define gc getchar
template <typename T> inline void write(T x)
{
	int i = 20;
	char buf[21];
	// buf[10] = 0;
	buf[20] = '\n';

	do
	{
		buf[--i] = x % 10 + '0';
		x/= 10;
	}while(x);
	do
	{
		putchar(buf[i]);
	} while (buf[i++] != '\n');
}

template <typename T> inline T readInt()
{
	T n=0,s=1;
	char p=gc();
	if(p=='-')
		s=-1;
	while((p<'0'||p>'9')&&p!=EOF&&p!='-')
		p=gc();
	if(p=='-')
		s=-1,p=gc();
	while(p>='0'&&p<='9') {
		n = (n<< 3) + (n<< 1) + (p - '0');
		p=gc();
	}

	return n*s;
}

int main()
{

	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
	#endif
	//begin
	int t = read(long long);
	while(t--){
		double a = read(long long) , b = read(long long);
		if(a== 0 && b == 0){
			cout<<"1\n";
			continue;
		}else if(a == 0){
			cout<<"0.5\n";
		}else if(b == 0){
			cout<<"1\n";
		}else{
			if(a/4 <= b){
				double ans = a*b + (0.5)*a*(a/4);
				printf("%.9lf\n",ans/(2*a*b));
			}else{
				double ans = 2*a*b - (0.5)*(4*b)*(a/4);
				printf("%.9lf\n",ans/(2*a*b));
			}
		}
	}
}


#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define read(type) readInt<type>()
#define gc getchar
template <typename T> inline void write(T x)
{
	int i = 20;
	char buf[21];
	// buf[10] = 0;
	buf[20] = '\n';

	do
	{
		buf[--i] = x % 10 + '0';
		x/= 10;
	}while(x);
	do
	{
		putchar(buf[i]);
	} while (buf[i++] != '\n');
}

template <typename T> inline T readInt()
{
	T n=0,s=1;
	char p=gc();
	if(p=='-')
		s=-1;
	while((p<'0'||p>'9')&&p!=EOF&&p!='-')
		p=gc();
	if(p=='-')
		s=-1,p=gc();
	while(p>='0'&&p<='9') {
		n = (n<< 3) + (n<< 1) + (p - '0');
		p=gc();
	}

	return n*s;
}

int main()
{

	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
	#endif
	//begin
	int t = read(long long);
	while(t--){
		double a = read(long long) , b = read(long long);
		if(a== 0 && b == 0){
			cout<<"1\n";
			continue;
		}else if(a == 0){
			cout<<"0.5\n";
		}else if(b == 0){
			cout<<"1\n";
		}else{
			if(a/4 <= b){
				double ans = a*b + ((0.5)*a*a)/4;
				printf("%.9lf\n",ans/(2*a*b));
			}else{
				double ans = 2*a*b - ((0.5)*(4*b)*(b));
				printf("%.9lf\n",ans/(2*a*b));
			}
		}
	}
}


#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define read(type) readInt<type>()
#define gc getchar
template <typename T> inline void write(T x)
{
	int i = 20;
	char buf[21];
	// buf[10] = 0;
	buf[20] = '\n';

	do
	{
		buf[--i] = x % 10 + '0';
		x/= 10;
	}while(x);
	do
	{
		putchar(buf[i]);
	} while (buf[i++] != '\n');
}

template <typename T> inline T readInt()
{
	T n=0,s=1;
	char p=gc();
	if(p=='-')
		s=-1;
	while((p<'0'||p>'9')&&p!=EOF&&p!='-')
		p=gc();
	if(p=='-')
		s=-1,p=gc();
	while(p>='0'&&p<='9') {
		n = (n<< 3) + (n<< 1) + (p - '0');
		p=gc();
	}

	return n*s;
}

int main()
{

	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
	#endif
	//begin
	int t = read(long long);
	while(t--){
		double a = read(long long) , b = read(long long);
		if(a== 0 && b == 0){
			cout<<"1\n";
			continue;
		}else if(a == 0){
			cout<<"0.5\n";
		}else if(b == 0){
			cout<<"1\n";
		}else{
			if(a/4 <= b){
				double ans = a*b + ((0.5)*a*a)/4;
				printf("%.9lf\n",ans/(2*a*b));
			}else{
				double ans = 2*a*b - ((0.5)*(4*b)*(a))/4;
				printf("%.9lf\n",ans/(2*a*b));
			}
		}
	}
}


#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define read(type) readInt<type>()
#define gc getchar
template <typename T> inline void write(T x)
{
	int i = 20;
	char buf[21];
	// buf[10] = 0;
	buf[20] = '\n';

	do
	{
		buf[--i] = x % 10 + '0';
		x/= 10;
	}while(x);
	do
	{
		putchar(buf[i]);
	} while (buf[i++] != '\n');
}

template <typename T> inline T readInt()
{
	T n=0,s=1;
	char p=gc();
	if(p=='-')
		s=-1;
	while((p<'0'||p>'9')&&p!=EOF&&p!='-')
		p=gc();
	if(p=='-')
		s=-1,p=gc();
	while(p>='0'&&p<='9') {
		n = (n<< 3) + (n<< 1) + (p - '0');
		p=gc();
	}

	return n*s;
}

int main()
{

	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
	#endif
	//begin
	int t = read(long long);
	while(t--){
		double a = read(long long) , b = read(long long);
		if(a== 0 && b == 0){
			cout<<"1\n";
			continue;
		}else if(a == 0){
			cout<<"0.5\n";
		}else if(b == 0){
			cout<<"1\n";
		}else{
			if(a/4 <= b){
				double ans = a*b + ((0.5)*a*a)/4;
				printf("%.9lf\n",ans/(2*a*b));
			}else{
				double ans = 2*a*b - ((0.5)*(4*b)*(b))/4;
				printf("%.9lf\n",ans/(2*a*b));
			}
		}
	}
}


#include<bits/stdc++.h>
using namespace std;

#define int long long
#define mod 1000000007
#define maxn 200005
#define endl '\n'

int dp[maxn];

void solve(){
    double a , b;
    cin>>a>>b;
    double num , den = 2.00 * b * a;
    if(a / 4.00 > b){
        double area = 0.500 * b * 4.00 * b;
        num = den - area;
    }else{
        double area = 0.500 * a * (a / 4.00);
        num = (den / 2.00) + area;
    }
    printf("%0.9lf\n" , num / den);

}

int32_t main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr) , cout.tie(nullptr);
    int t = 1;
    cin>>t;
    while(t--)
        solve();
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define int long long
#define mod 1000000007
#define maxn 200005
#define endl '\n'

int dp[maxn];

void solve(){
    double a , b;
    cin>>a>>b;
    double num , den = 2.00 * b * a;
    if(a / 4.00 > b){
        double area = 0.500 * b * 4.00 * b;
        num = den - area;
    }else{
        double area = 0.500 * a * (a / 4.00);
        num = (den / 2.00) + area;
    }
    if(a == 0.00 && b == 0.00){
        printf("%0.9lf\n" , 1.00);
    }else if(a == 0.00){
        printf("%0.9lf\n" , 0.500);
    }else if(b == 0.00){
        printf("%0.9lf\n" , 1.00);
    }else{
        printf("%0.9lf\n" , num / den);
    }
}

int32_t main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr) , cout.tie(nullptr);
    int t = 1;
    cin>>t;
    while(t--)
        solve();
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define int long long
#define mod 1000000007
#define maxn 200005
#define endl '\n'

int dp[maxn];

void solve(){
    double a , b;
    cin>>a>>b;
    double num , den = 2.00 * b * a;
    if(a / 4.00 > b){
        double area = 0.500 * b * 4.00 * b;
        num = den - area;
    }else{
        double area = 0.500 * a * (a / 4.00);
        num = (den / 2.00) + area;
    }
    if(den == 0){
        printf("%0.9lf\n" , 1.00);
    }else printf("%0.9lf\n" , num / den);

}

int32_t main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr) , cout.tie(nullptr);
    int t = 1;
    cin>>t;
    while(t--)
        solve();
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define int long long
#define mod 1000000007
#define maxn 200005
#define endl '\n'

int dp[maxn];

void solve(){
    double a , b;
    cin>>a>>b;
    double num , den = 2.00 * b * a;
    if(a / 4.00 > b){
        double area = 0.500 * b * 4.00 * b;
        num = den - area;
    }else{
        double area = 0.500 * a * (a / 4.00);
        num = (den / 2.00) + area;
    }
    if(den == 0){
        printf("%0.9lf\n" , 0.00);
    }else printf("%0.9lf\n" , num / den);

}

int32_t main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr) , cout.tie(nullptr);
    int t = 1;
    cin>>t;
    while(t--)
        solve();
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define int long long
#define mod 1000000007
#define maxn 200005
#define endl '\n'

int dp[maxn];

void solve(){
    double a , b;
    cin>>a>>b;
    double num , den = 2.00 * b * a;
    if(a / 4.00 > b){
        double area = 0.500 * b * 4.00 * b;
        num = den - area;
    }else{
        double area = 0.500 * a * (a / 4.00);
        num = (den / 2) + area;
    }
    printf("%0.9lf\n" , num / den);

}

int32_t main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr) , cout.tie(nullptr);
    int t = 1;
    cin>>t;
    while(t--)
        solve();
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0);
    int t; cin >> t; while (t--) {
        long double p, q; cin >> p >> q;
        if (p == 0 && q == 0) { cout << 1.0000000000 << endl; continue; }
        if (p == 0) { cout << 0.500000000000 << endl; continue; }
        if (q == 0) { cout << 1.000000000000 << endl; continue; }
        long double y = p / 4.0;
        pair<long double, long double> pt;
        if (y >= -q && y <= q) pt = make_pair(p, y);
        long double x = 4 * q;
        if (x >= 0 && x <= p) pt = make_pair(x, q);
        x = -4 * q;
        if (x >= 0 && x <= p) pt = make_pair(x, -q);
        if (pt.first == p) {
            long double len = q - pt.second;
            cout << fixed << setprecision(20) << (p * 2 * q - (len + q) * p / 2.0) / (p * 2 * q) << endl;
        } else if (pt.second == q) {
            long double len = pt.first;
            cout << fixed << setprecision(20) << (p * 2 * q - q * len / 2) / (p * 2 * q) << endl;
        } else {
            long double len = pt.first;
            cout << fixed << setprecision(20) << (q * len / 2) / (p * 2 * q) << endl;
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0);
    int t; cin >> t; while (t--) {
        long double p, q; cin >> p >> q;
        if (p == q && q == 0) { cout << 1.0000000000 << endl; continue; }
        long double y = p / 4.0;
        pair<long double, long double> pt;
        if (y >= -q && y <= q) pt = make_pair(p, y);
        long double x = 4 * q;
        if (x >= 0 && x <= p) pt = make_pair(x, q);
        x = -4 * q;
        if (x >= 0 && x <= p) pt = make_pair(x, -q);
        if (pt.first == p) {
            long double len = q - pt.second;
            cout << fixed << setprecision(20) << (p * 2 * q - (len + q) * p / 2.0) / (p * 2 * q) << endl;
        } else if (pt.second == q) {
            long double len = pt.first;
            cout << fixed << setprecision(20) << (p * 2 * q - q * len / 2) / (p * 2 * q) << endl;
        } else {
            long double len = pt.first;
            cout << fixed << setprecision(20) << (q * len / 2) / (p * 2 * q) << endl;
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0);
    int t; cin >> t; while (t--) {
        long double p, q; cin >> p >> q;
        if (p == q && q == 0) { cout << 1.0000000000 << endl; continue; }
        if (p == 0 || q == 0) { cout << 1.000000000000 << endl; continue; }
        long double y = p / 4.0;
        pair<long double, long double> pt;
        if (y >= -q && y <= q) pt = make_pair(p, y);
        long double x = 4 * q;
        if (x >= 0 && x <= p) pt = make_pair(x, q);
        x = -4 * q;
        if (x >= 0 && x <= p) pt = make_pair(x, -q);
        if (pt.first == p) {
            long double len = q - pt.second;
            cout << fixed << setprecision(20) << (p * 2 * q - (len + q) * p / 2.0) / (p * 2 * q) << endl;
        } else if (pt.second == q) {
            long double len = pt.first;
            cout << fixed << setprecision(20) << (p * 2 * q - q * len / 2) / (p * 2 * q) << endl;
        } else {
            long double len = pt.first;
            cout << fixed << setprecision(20) << (q * len / 2) / (p * 2 * q) << endl;
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0);
    int t; cin >> t; while (t--) {
        long double p, q; cin >> p >> q;
        if (p == q && q == 0) { cout << 1.0000000000 << endl; continue; }
        if (p == 0 || q == 0) { cout << 0.500000000000 << endl; continue; }
        long double y = p / 4.0;
        pair<long double, long double> pt;
        if (y >= -q && y <= q) pt = make_pair(p, y);
        long double x = 4 * q;
        if (x >= 0 && x <= p) pt = make_pair(x, q);
        x = -4 * q;
        if (x >= 0 && x <= p) pt = make_pair(x, -q);
        if (pt.first == p) {
            long double len = q - pt.second;
            cout << fixed << setprecision(20) << (p * 2 * q - (len + q) * p / 2.0) / (p * 2 * q) << endl;
        } else if (pt.second == q) {
            long double len = pt.first;
            cout << fixed << setprecision(20) << (p * 2 * q - q * len / 2) / (p * 2 * q) << endl;
        } else {
            long double len = pt.first;
            cout << fixed << setprecision(20) << (q * len / 2) / (p * 2 * q) << endl;
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0);
    int t; cin >> t; while (t--) {
        long double p, q; cin >> p >> q;
        if (p == q && q == 0) { cout << 1.0000000000 << endl; continue; }
        long double y = p / 4.0;
        pair<long double, long double> pt;
        if (y >= -q && y <= q) pt = make_pair(p, y);
        long double x = 4 * q;
        if (x >= 0 && x <= q) pt = make_pair(x, q);
        x = -4 * q;
        if (x >= 0 && x <= q) pt = make_pair(x, -q);
        if (pt.first == p) {
            long double len = q - pt.second;
            cout << fixed << setprecision(20) << (p * 2 * q - (len + q) * p / 2.0) / (p * 2 * q) << endl;
        } else if (pt.second == q) {
            long double len = pt.first;
            cout << fixed << setprecision(20) << (p * 2 * q - q * len / 2) / (p * 2 * q) << endl;
        } else {
            long double len = pt.first;
            cout << fixed << setprecision(20) << (q * len / 2) / (p * 2 * q) << endl;
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0);
    int t; cin >> t; while (t--) {
        long double p, q; cin >> p >> q;
        if (p == q && q == 0) { cout << 1.0000000000 << endl; continue; }
        if (p == 0 || q == 0) { cout << 0.000000000000 << endl; continue; }
        long double y = p / 4.0;
        pair<long double, long double> pt;
        if (y >= -q && y <= q) pt = make_pair(p, y);
        long double x = 4 * q;
        if (x >= 0 && x <= p) pt = make_pair(x, q);
        x = -4 * q;
        if (x >= 0 && x <= p) pt = make_pair(x, -q);
        if (pt.first == p) {
            long double len = q - pt.second;
            cout << fixed << setprecision(20) << (p * 2 * q - (len + q) * p / 2.0) / (p * 2 * q) << endl;
        } else if (pt.second == q) {
            long double len = pt.first;
            cout << fixed << setprecision(20) << (p * 2 * q - q * len / 2) / (p * 2 * q) << endl;
        } else {
            long double len = pt.first;
            cout << fixed << setprecision(20) << (q * len / 2) / (p * 2 * q) << endl;
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,m,i,j,k,l;
    int a,b;
    cin>>n;
    while(n--)
    {
        cin>>a>>b;
        double x,y,z;
        x = a/4.0;
        if(x>b)
        {
            x = 2*b*b;
            y = 2*a*b;
            z = x/y;
            //cout<<z<<endl;
            z = 1-z;
            //cout<<x<<" "<<y<<" "<<z<<endl;
            printf("%.10f\n",z);
            continue;
        }
        x = a*a;
        x /= 8.0;
        x += a*b;
        y = 2*a*b;
        z=(x/y);
        printf("%.10f\n",z);
    }

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,m,i,j,k,l;
    long long int a,b,p,q;
    cin>>n;
    while(n--)
    {
        cin>>a>>b;
        if(b==0)
        {
            cout<<1<<endl;
            continue;
        }
        if(a==0)
        {
            cout<<.5<<endl;
            continue;
        }
        double x,y,z;
        x = a/4.0;
        if(x>b)
        {

            z = (double)b/a;
            //cout<<z<<endl;
            z = 1.0-z;
            //cout<<x<<" "<<y<<" "<<z<<endl;
            printf("%.10f\n",z);
            continue;
        }
        x = (double)a/8.0;

        x += b;
        y = 2*b;
        z=(x/y);
        printf("%.10f\n",z);
    }

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,m,i,j,k,l;
    int a,b;
    cin>>n;
    while(n--)
    {
        cin>>a>>b;
        if(b==0)
        {
            cout<<1<<endl;
            continue;
        }
        if(a==0)
        {
            cout<<.5<<endl;
            continue;
        }
        double x,y,z;
        x = a/4.0;
        if(x>b)
        {
            x = 2*b*b;
            y = 2*a*b;
            z = x/y;
            //cout<<z<<endl;
            z = 1-z;
            //cout<<x<<" "<<y<<" "<<z<<endl;
            printf("%.10f\n",z);
            continue;
        }
        x = a*a;
        x /= 8.0;
        x += a*b;
        y = 2*a*b;
        z=(x/y);
        printf("%.10f\n",z);
    }

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,m,i,j,k,l;
    int a,b;
    cin>>n;
    while(n--)
    {
        cin>>a>>b;
        double x,y,z;
        x = a*a;
        x /= 8.0;
        x += a*b;
        y = 2*a*b;
        z=(x/y);
        printf("%.10f\n",z);
    }

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,m,i,j,k,l;
    int a,b;
    cin>>n;
    while(n--)
    {
        cin>>a>>b;
        if(a==0 || b==0)
        {
            cout<<0<<endl;
            continue;
        }
        double x,y,z;
        x = a/4.0;
        if(x>b)
        {
            x = 2*b*b;
            y = 2*a*b;
            z = x/y;
            //cout<<z<<endl;
            z = 1-z;
            //cout<<x<<" "<<y<<" "<<z<<endl;
            printf("%.10f\n",z);
            continue;
        }
        x = a*a;
        x /= 8.0;
        x += a*b;
        y = 2*a*b;
        z=(x/y);
        printf("%.10f\n",z);
    }

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,m,i,j,k,l;
    int a,b;
    cin>>n;
    while(n--)
    {
        cin>>a>>b;
        if(a==0 || b==0)
        {
            cout<<1<<endl;
            continue;
        }
        double x,y,z;
        x = a/4.0;
        if(x>b)
        {
            x = 2*b*b;
            y = 2*a*b;
            z = x/y;
            //cout<<z<<endl;
            z = 1-z;
            //cout<<x<<" "<<y<<" "<<z<<endl;
            printf("%.10f\n",z);
            continue;
        }
        x = a*a;
        x /= 8.0;
        x += a*b;
        y = 2*a*b;
        z=(x/y);
        printf("%.10f\n",z);
    }

}


#include <bits/stdc++.h>
#define LL long long
#define PII pair<int,int>
#define PIL pair<int,LL>
#define PLI pair<LL,int>
#define PIII pair<int,PII>
#define PLL pair<LL,LL>
#define PLII pair<LL,PII>
#define VI vector<int>
#define VVI vector<VI>
#define VL vector<LL>
#define VVL vector<VL>
#define VPII vector<PII>
#define FF first
#define SS second
#define MP make_pair
#define PB push_back
#define all(x) x.begin(),x.end()
#define watch(x) cout<<(#x)<<" = "<<(x)<<'\n'
#define mset(a,v) memset(a,v,sizeof(a))
#define setp(x) cout<<fixed<<setprecision(x)
#define EPS 0.00000000001
#define PI acos(-1)
#define loop(i,b,n) for(int i=b;i<n;++i)
#define rev_loop(i,b,n) for(int i=b;i>=n;--i)
using namespace std;

const int MOD = 1e9 + 7;
const LL MX = 1e9;
const LL INF = 1e9;

int main()
{
    //ofstream out("output.txt");
    //ifstream in("input.txt");
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

    int t;
    LL a,b;
    cin>>t;

    while(t--)
    {
        cin>>a>>b;
        double ans;
        if(a == 0 && b == 0) ans = 1;
        else if(a == 0) ans = b;
        else if(b == 0) ans = a;
        else
        {
            if(a > (4*b))
            {
                LL a1 = 4*b, a2 = a - a1;
                ans = (((a1 * a1) / 8.0) + (b * (a + a2))) / (2.0 * a * b);
            }
            else ans = (a + (8.0 * b)) / (16.0 * b);
        }

        setp(9);
        cout<<ans<<'\n';
    }

    /*
    int t,n;
    cin>>t;
    while(t--)
    {
        cin>>n;
        int a[n];
        loop(i,0,n)
        {
            cin>>a[i];
        }
    }
    */

    /*
    int n;
    cin>>n;
    int a[n];
    loop(i,0,n)
    {
        cin>>a[i];
    }
    */

    /*
    cout<<ans<<'\n';

    if(f) cout<<"YES\n";
    else cout<<"NO\n";

    if(f) cout<<"Yes\n";
    else cout<<"No\n";
    */

    return 0;
}


#include <bits/stdc++.h>
#define LL long long
#define PII pair<int,int>
#define PIL pair<int,LL>
#define PLI pair<LL,int>
#define PIII pair<int,PII>
#define PLL pair<LL,LL>
#define PLII pair<LL,PII>
#define VI vector<int>
#define VVI vector<VI>
#define VL vector<LL>
#define VVL vector<VL>
#define VPII vector<PII>
#define FF first
#define SS second
#define MP make_pair
#define PB push_back
#define all(x) x.begin(),x.end()
#define watch(x) cout<<(#x)<<" = "<<(x)<<'\n'
#define mset(a,v) memset(a,v,sizeof(a))
#define setp(x) cout<<fixed<<setprecision(x)
#define EPS 0.00000000001
#define PI acos(-1)
#define loop(i,b,n) for(int i=b;i<n;++i)
#define rev_loop(i,b,n) for(int i=b;i>=n;--i)
using namespace std;

const int MOD = 1e9 + 7;
const LL MX = 1e9;
const LL INF = 1e9;

int main()
{
    //ofstream out("output.txt");
    //ifstream in("input.txt");
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

    int t;
    LL a,b;
    cin>>t;

    while(t--)
    {
        cin>>a>>b;
        double ans;
        if(b == 0) ans = 1;
        else if(a == 0) ans = 1.0 / 2.0;
        else
        {
            if(a > (4*b))
            {
                LL a1 = 4*b, a2 = a - a1;
                ans = (((a1 * a1) / 8.0) + (b * (a + a2))) / (2.0 * a * b);
            }
            else ans = (a + (8.0 * b)) / (16.0 * b);
        }

        setp(9);
        cout<<ans<<'\n';
    }

    /*
    int t,n;
    cin>>t;
    while(t--)
    {
        cin>>n;
        int a[n];
        loop(i,0,n)
        {
            cin>>a[i];
        }
    }
    */

    /*
    int n;
    cin>>n;
    int a[n];
    loop(i,0,n)
    {
        cin>>a[i];
    }
    */

    /*
    cout<<ans<<'\n';

    if(f) cout<<"YES\n";
    else cout<<"NO\n";

    if(f) cout<<"Yes\n";
    else cout<<"No\n";
    */

    return 0;
}