semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
void function(int,int);

int main()
{
   char s[200][100];
   int n[100],h[100],maxh[100];
   int a;
   int i,j,k,p;
   int num,maxnum=0;
   char c;

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

   for(j='A';j<='Z';j++)
   {
       num=0;
       for(i=0;i<a;i++)
       {
          for(k=0;k<strlen(s[i]);k++)
          {
             if(s[i][k]==j)
             {
                 num++;
                 h[num]=n[i] ;
             }
          }
       }
       if(num>maxnum)
       {
          c=j;
          maxnum=num;
          for(p=1;p<=maxnum;p++)
          {
             maxh[p]=h[p];
          }
       }
   }

   printf("%c\n%d\n",c,maxnum);
   for(p=1;p<=maxnum;p++)
   {
       printf("%d\n",maxh[p]);
   }
   return 0;

}
struct Article {
	int number;
	char author[26];
};

int main()
{
	struct Article book[1000];
	int m, i;
	int j, k;
	int c;
	int max = 0;
	int writer[26] = {0};
	
	scanf("%d",&m);
	for (i = 0; i < m; i++) {
		scanf("%d %s",&book[i].number,book[i].author);
	}
	
	for (i = 0; i < m; i++) {
		for (j = 0; j < 26; j++) {
			if (book[i].author[j] >= 'A' && book[i].author[j] <= 'Z') {
				c = book[i].author[j] - 'A';
				writer[c]++;
			}
		}
	}
	
	for (i = 0; i < 26; i++) {
		if (max < writer[i]) {
			max = writer[i];
		}
	}
	
	for (i = 0; i < 26; i++) {
		if (max == writer[i]) {
			printf("%c\n",i + 'A');
			printf("%d\n",max);
			for (j = 0; j < m; j++) {
				for (k = 0; k < 26; k++) {
					if (book[j].author[k] == i + 'A') {
						printf("%d\n",book[j].number);
					}
				}
			}
			break;
		}
	}
	return 0;
}
void main()
{
	struct ts
	{
		int sl;
		char zz[30];
		int zzsl;
		struct ts *next;
	};
	struct ts *p1,*p2,*head;
	int i,j,k,m,n,max,zzzdnum,num[100]={0};
	char zzzd;
	scanf("%d",&n);
	p1=p2=head=(struct ts *)malloc(sizeof(struct ts));
	scanf("%d %s",&p1->sl,p1->zz);
//	p1->zzsl=strlen(p1->zz);//?????
	for(i=1;i<n;i++)
	{
		p1=(struct ts *)malloc(sizeof(struct ts));
		scanf("%d %s",&p1->sl,p1->zz);
		p1->zzsl=strlen(p1->zz);
		p2->next=p1;
		p2=p1;
	}
	p1->next=0;
	for(i='A';i<='Z';i++)
	{
		p1=head;
		for(k=0;k<n;k++)
		{
			for(j=0;p1->zz[j]!='\0';j++)
			{
				if(p1->zz[j]==i)num[i]++;
			}
			p1=p1->next;
		}
	}
	max=0;
	for(i='A';i<='Z';i++)
	{
		max=max>num[i]?max:num[i];
	}
	for(i='A';i<='Z';i++)
	{
		if(num[i]==max)zzzd=i;//????????
	}
	printf("%c\n%d\n",zzzd,max);
	p1=head;
	zzzdnum=0;
	for(i=0;i<n;i++)
	{
		for(j=0;p1->zz[j]!='\0';j++)
		{
			if(p1->zz[j]==zzzd)
			{
				printf("%d\n",p1->sl);
			}
		}
		p1=p1->next;
	}
}
char name;
int num,k=0,t=0;
int nametimes[100]={0};
struct book
{
	unsigned int No;
	char Name[26];
}*p;
void operate()
{
	int i;
	for(i=65;i<91;i++)
		if(nametimes[i]>t)
		{
			t=nametimes[i];
			name=i;
		}
}
void print()
{
	struct book *pi;
	int i;
	printf("%c\n%d\n",name,t);
	for(pi=p;pi<p+num;pi++)
		for(i=0;pi->Name[i]!='\0';i++)
			if(pi->Name[i]==name)
			{
				if(k==0)
				{
					printf("%d",pi->No);
					k++;
				}
				else
					printf("\n%d",pi->No);
				break;
			}
}
main()
{
	scanf("%d",&num);
	struct book *pi;
	int i;
	p=(struct book*)malloc(num*sizeof(struct book));
	for(pi=p;pi<p+num;pi++)
	{
		scanf("%d %s",&pi->No,pi->Name);
		for(i=0;pi->Name[i]!='\0';i++)
			nametimes[(int)pi->Name[i]]++;
	}
	operate();
	print();
}
void main()
{
    struct book
    {
    	int num;
    	char a[100];
    };
    struct book b[1000];
    int n,i,j,s,t=0,m,h;
    int c[1000];
    char d[27];
    scanf("%d",&n);
    for(i=0;i<n;i++)
    scanf("%d %s",&b[i].num,b[i].a);
    d[0]=b[0].a[0];
    t=1;
    c[0]=0;
    for(i=0;i<n;i++)
    {
    	for(j=0;b[i].a[j]!=0;j++)
    	{
    		int x=0;
    		for(s=0;s<t;s++)
    		{
    			if(b[i].a[j]==d[s])
    			{
    				c[s]=c[s]+1;
    				x=0;
    				break;
    			}
    			else
    			x=1;
    		}
    		if(x==1)
    		{
    			t++;
    			d[t-1]=b[i].a[j];
    			c[t-1]=1;
    		}
    	}
    }
    m=c[0];
    h=0;
    for(i=0;i<t;i++)
    {
    	if(c[i]>m)
    	{
    		m=c[i];
    	    h=i;
    	}
    }
    printf("%c\n%d\n",d[h],m);
    for(i=0;i<n;i++)
    {
    	for(j=0;b[i].a[j]!=0;j++)
    	{
    	    if(b[i].a[j]==d[h])
    		{
    			printf("%d\n",b[i].num);break;
    		}    				
    	}
    }
}
struct book
{
	int num;
	char author[26];
	struct book *next;
};
struct book *creat()
	{
		int n;
		scanf("%d",&n);
		int i=1;
		struct book *head,*p1,*p2;
		p1=(struct book*)malloc(LEN);
		scanf("%d %s",&p1->num,p1->author);
		p1->next=NULL;
		if(i>=n) {free(p1);head=NULL;return head;}
		else
		{head=p1;
		p2=p1;
		while(i<n)
		{p1=(struct book*)malloc(LEN);
		scanf("%d %s",&p1->num,p1->author);
		p1->next=NULL;
		i++;
		{p2->next=p1;p2=p1;}
		}
        p2->next=p1;
		p1->next=NULL;
		return head;
		}
	}
int max(char letter,struct book *head)
{
	int i,j,k;
	i=0;
	struct book *q;
	q=head;
	while(q!=NULL)
	{
		k=strlen(q->author);
		for(j=0;j<k;j++)
		{if((q->author)[j]==letter) i++;}
		q=q->next;
	}
	return i;
}
		
void outbook(char letter,struct book *head)
{
	int j,k;	
	struct book *q;
	q=head;
	while(q!=NULL)
	{
		k=strlen(q->author);
		for(j=0;j<k;j++)
		{if((q->author)[j]==letter) printf("%d\n",q->num);}
		q=q->next;
	}
}
void main()
{
	int i,m,s;
	struct book *p0,*p1;	
	p0=p1=creat();
	int sum[26];
	for(i=0;i<26;i++)
	{
		sum[i]=max(i+65,p0);
	}
	s=0;
	m=sum[0];
	for(i=0;i<26;i++)
	{
		if(sum[i]>m) {m=sum[i];s=i;}
	}
	printf("%c\n",s+65);
	printf("%d\n",m);
	outbook(s+65,p1);
}
void main()
{
	int n,i,best=0,max=0,a[26]={0},num[100],l,j,k;
	char letter[26]={'A','B','C','D','E','F','G','H','I','J','K',
	'L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'},
	writer[100][26];

	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d %s",&num[i],&writer[i]);
	}
	for(i=0;i<n;i++)
	{
		l=strlen(writer[i]);
		for(j=0;j<l;j++)
		{
			for(k=0;k<26;k++)
			{
				if(writer[i][j]==letter[k]) {a[k]++;break;}
			}
		}
	}
	for(i=0;i<26;i++)
	{
		if(max<a[i])
		{
			best=i;max=a[i];
		}
	}
	printf("%c\n",letter[best]);
	printf("%d\n",max);
	for(i=0;i<n;i++)
	{
		l=strlen(writer[i]);
		for(j=0;j<l;j++)
		{
				if(writer[i][j]==letter[best]) 
				{
					printf("%d\n",num[i]);;break;
				}
		}
	}
	
}
int main()
{
	int bookno[100];
	char author[100][26]; 
	int numOfauthor[26] = {0};
	int nbook, max = 0, maxno;
	char maxauthor;
	cin >> nbook;
	int i, j;
	for ( i = 0; i < nbook; i ++)
	{
		cin >> bookno[i];
		cin.get();
		cin.getline(*(author + i), 26);
	}
	for ( i = 0; i < nbook; i ++)
		for ( j = 0; author[i][j] !='\0'; j ++)
		{
			numOfauthor[author[i][j] - 'A'] ++;
		}
	for ( i = 0; i < 26; i ++)
	{
		if ( numOfauthor[i] > max)
		{
			max = numOfauthor[i];
			maxno = i;
		}
	}
	maxauthor = maxno + 'A';
	cout << maxauthor << endl;
	cout << numOfauthor[maxno] << endl;
	for ( i = 0; i < nbook; i ++)
		for ( j = 0; author[i][j] != '\0'; j ++)
		{
			if ( author[i][j] == maxauthor )
				cout << bookno[i] << endl;
		}
	return 0;
}
int main()
{
	int m;
	cin>>m;
	int book[1000];
	char person[]="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
	char people[100][100];
	int i,j;
	int l;
    int t[100]={0};
	for(i=1;i<=m;i++)
	{
		cin>>book[i];
		cin>>people[i];
		l=strlen(people[i]);
		for(j=0;j<l;j++)
		{
			t[people[i][j]-'A']++;
		}
		
	}
	int max=0,tt;
	for(i=0;i<=26;i++)
	{
		if(t[i]>max)
		{
		 max=t[i];
		 tt=i;
	    }
	}
	cout<<person[tt]<<endl;
	cout<<max<<endl;
	int k;
	int already[26]={1};
	for(i=1;i<=m;i++)
	{
		
		l=strlen(people[i]);
		for(j=0;j<l;j++)
		{
			if(people[i][j]==person[tt])
			 
			 {  
			     cout<<book[i]<<endl;
			   for(k=0;k<l;k++)
			   {
			   	 if((people[i][k]!=person[tt])&&(already[people[i][k]-'A']!=0))
			   	 {
			   	 	//cout<<people[i][k]<<endl;
			   	 	already[people[i][k]-'A']=0;
			   	 }
			   	
			   }
			   break;
			   	
			 }
		}
		
	}
	return 0;
	
}
struct book
   {
	   int num;
	   char writer[26];
   };
   int m;

int main()
{

  int i;
   scanf("%d",&m);
	book *p;
	p=(struct book*)malloc(sizeof(struct book)*m);
	for(i=0;i<m;i++)
	{
		scanf("%d %s",&p[i].num,p[i].writer);
	}
	int j=0,u=0;
	int *a;
	a=(int *)malloc(sizeof(int)*150);
	for(i='A';i<='z';i++)
	a[i]=0;

	for(i='A';i<='Z';i++)
	{
		for(j=0;j<m;j++)
		{
			for(u=0;u<strlen(p[j].writer);u++)
			{
				if(i==p[j].writer[u])
				{
					a[i]++;
					break;
				}
			}
		}
	}
	int max=0;
	for(i='A';i<='Z';i++)
	{
		if(max<a[i])
			max=a[i];
	}
	for(i='A';i<='Z';i++)
	{
		if(max==a[i])
		break;	
	}
	printf("%c\n%d\n",i,a[i]);
	for(j=0;j<m;j++)
	{
          for(u=0;u<strlen(p[j].writer);u++)
			{
				if(i==p[j].writer[u])
				{
				    printf("%d\n",p[j].num);
					break;
				}
			}	
	}	

	





   return 0;
}
void main()
{
	int a[1000],i,j,m,b[26],t=0,k;
	char c[1000][20];
	scanf("%d",&m);
	for(i=0;i<m;i++)
		scanf("%d %s",&a[i],c[i]);
         for(i=0;i<m;i++)
		for(j=0;j<strlen(c[i]);j++)
			if('A'<c[i][j]<'Z') b[c[i][j]-65]++;
	for(i=0;i<26;i++)
		if(b[i]>t){t=b[i];k=i;}
		printf("%c\n",k+65);
		printf("%d\n",t);
for(i=0;i<m;i++)
for(j=0;j<strlen(c[i]);j++)
{
   if(c[i][j]==k+65) printf("%d\n",a[i]);
}
}
int main()
{
    char temp,s;
    int i,j,t[27][2000],m,n,a[27] = {0},num[2000],x;
    {
        cin >> n;
        for (i = 1; i <= n; i++ )
        {
            cin >> num[i];
            temp = cin.get();
            while (temp == '\n' || temp == ' ' )
            {
                temp = cin.get();
            }
            for (j = 1; 1; j++ )
            {
                x = temp - 'A' + 1;
                t[x][a[x]] = num[i];
                a[x]++;
                temp = cin.get();
                if (temp == '\n')
                {
                    break;
                }
            }
        }
        m = 0;
        for (i = 1; i <= 26; i++)
        {
            if (a[i] > a[m])
            {
                m = i;
            }
        }
        s = m + 'A' - 1;
        cout << s << endl << a[m] << endl;
        for (i = 0; i < a[m]; i++)
        {
            cout << t[m][i] << endl;
        }
    }
}
void main()
{
	struct book
	{
		int num;
		char author[27];
		struct book *next;
	}*head = 0,*p1,*p2;
	int total,i,j,sumbook[26]={0},len,max;
	scanf("%d",&total);
	for(i=0;i<total;i++)
	{
		p1=(struct book *)malloc(sizeof(struct book));
		if(p1==0)
		{
			printf("Memory request failed!\n");
			exit(-1);
		}
		scanf("%d %s",&p1->num,p1->author);
		len = strlen(p1->author);
		for(j = 0;j<len;j++)
			sumbook[p1->author[j]-'A']++;
		if(head)
			p2->next=p1;
		else
			head=p1;
		p2=p1;
	}
	p1->next=0;
	len = 0;
	for(i = 0;i<26;i++)
	{
		if(sumbook[i]>len)
		{
			len = sumbook[i];
			max = i;
		}
	}
	printf("%c\n%d\n",max+'A',sumbook[max]);
	max += 'A';
	for(p1=head;p1;p1=p1->next)
	{
		len = strlen(p1->author);
		for(i = 0;i<len;i++)
		{
			if(p1->author[i]==max)
			{
				printf("%d\n",p1->num);
				break;
			}
		}
	}
}
struct a
{
	int number;
	char author[26];
}b[100];
int main()
{
	int L[26]={0};
	int n=0;
	int max=0;
	int p=0;
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>b[i].number;
		cin>>b[i].author;
		for(int j=0;b[i].author[j]!='\0';j++)
			L[b[i].author[j]-'A']++;
	}
	for(int i=0;i<26;i++)
		if(max<L[i])
		{
			p=i;
			max=L[i];
		}
	cout<<(char)(p+'A')<<endl;
	cout<<max<<endl;
	for(int i=0;i<n;i++)
	{
		for(int j=0;b[i].author[j]!='\0';j++)
		{
			if(b[i].author[j]-p=='A')
			{
				cout<<b[i].number<<endl;
				break;
			}
		}
	}
	return 0;
}
struct  book  
{
    int  num;
    char  name[27];
    struct  book  *next;
};
   int  m;
struct  book   *head;   
   
struct   book  *setup()
{   int  t=0;
    struct  book  *head,*p1,*p2;
    head=p1=p2=(struct  book  *)malloc(sizeof  (struct  book));
    scanf("%d %s",&p1->num,p1->name);
    while(t<m)
    {   t++;
        p2->next=p1;
        p2=p1;
        p1=(struct  book  *)malloc(sizeof(struct  book));
        scanf("%d %s",&p1->num,p1->name);
    }
    p2->next=NULL;
    
    return(head);
}
   int   k=0,max=0;
void   found(struct  book  *p)
{     int  i,j;
      p=head;
      int  *pi;
      pi=(int *)malloc(sizeof(int)*26);
      for(i=0;i<26;i++)  *(pi+i)=0;
      for(i=0;i<m;i++)
         {
              for(j=0;p->name[j]!='\0';j++)
              {       
                         (*(pi+(p->name[j]-'A')))++;
              }
             p=p->next;
         }  
         for(j=0;j<26;j++)
          {  
                  if(*(pi+j)>max){
                   max=*(pi+j);
                   k=j;
                   }
          } 
          
}          
      int  main()
{   int  i,j;
    scanf("%d",&m);
    struct book *p;
     head=p=setup();
     found(p);
     printf("%c\n%d\n",(k+'A'),max); 
     p=head;
     for(i=0;i<m;i++)
        {for(j=0;p->name[j]!='\0';j++)
           if(p->name[j]==k+'A'){
           printf("%d\n",p->num);
           break;
           }
           p=p->next;
        }  
}
struct shu
{int num;
 char author[26];
};

void main()
{
  struct shu shu[999];
  int n,i,j,k,m;
  scanf("%d",&n);
  for(i=0;i<n;i++) 
    scanf("%d %s",&shu[i].num,shu[i].author);
  int a[26]={0};
  for(i=0;i<n;i++)
  {
    for(j=0;j<26;j++)
	{
	  if(shu[i].author[j]=='A') a[0]=a[0]+1;
      else if(shu[i].author[j]=='B') a[1]=a[1]+1;
      else if(shu[i].author[j]=='C') a[2]=a[2]+1;
      else if(shu[i].author[j]=='D') a[3]=a[3]+1;
      else if(shu[i].author[j]=='E') a[4]=a[4]+1;
      else if(shu[i].author[j]=='F') a[5]=a[5]+1;
      else if(shu[i].author[j]=='G') a[6]=a[6]+1;
      else if(shu[i].author[j]=='H') a[7]=a[7]+1;
      else if(shu[i].author[j]=='I') a[8]=a[8]+1;
      else if(shu[i].author[j]=='J') a[9]=a[9]+1;
      else if(shu[i].author[j]=='K') a[10]=a[10]+1;
      else if(shu[i].author[j]=='L') a[11]=a[11]+1;
      else if(shu[i].author[j]=='M') a[12]=a[12]+1;
      else if(shu[i].author[j]=='N') a[13]=a[13]+1;
      else if(shu[i].author[j]=='O') a[14]=a[14]+1;
      else if(shu[i].author[j]=='P') a[15]=a[15]+1;
      else if(shu[i].author[j]=='Q') a[16]=a[16]+1;
      else if(shu[i].author[j]=='R') a[17]=a[17]+1;
      else if(shu[i].author[j]=='S') a[18]=a[18]+1;
      else if(shu[i].author[j]=='T') a[19]=a[19]+1;
      else if(shu[i].author[j]=='U') a[20]=a[20]+1;
      else if(shu[i].author[j]=='V') a[21]=a[21]+1;
      else if(shu[i].author[j]=='W') a[22]=a[22]+1;
      else if(shu[i].author[j]=='X') a[23]=a[23]+1;
      else if(shu[i].author[j]=='Y') a[24]=a[24]+1;
      else if(shu[i].author[j]=='Z') a[25]=a[25]+1;
	}
  }
  k=a[0],m=0;
  for(i=0;i<26;i++)
  {
    if(k<a[i]) 
	{
	  k=a[i];
	  m=i;
	}
  }
  char b[26]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
  printf("%c\n",b[m]);
  printf("%d\n",k);
  for(i=0;i<n;i++)
  {
    for(j=0;j<26;j++)
	{
	  if(shu[i].author[j]==b[m])
	  {
	    printf("%d\n",shu[i].num);
		break;
	  }
	}
  }
}
int a[30]={0},b[30][1000];
struct stu
{
	int num;
	char name[30];
	
	struct stu *next;
};
struct stu *creat(int n)
{
	struct stu *p1,*p2,*head;
	int i=0;
	p1=p2=(struct stu *)malloc(sizeof(struct stu));
	scanf("%d %s",&p1->num,p1->name);
	head=0;
	for(i=0;i<n;i++)
	{
		if(i==0)
			head=p1;
		else
			p2->next=p1;
		p2=p1;
		if(i<n-1)
		{
			p1=(struct stu *)malloc(sizeof(struct stu));
			scanf("%d %s",&p1->num,p1->name);
		}
	}
	p2->next=0;
	return head;
}
int check(struct stu *head,int n)
{
	int i,j,s,d=0,f=0;
	char *t;
	struct stu *p;
	p=head;
	for(i=0;i<n;i++,p=p->next)
	{
		s=strlen(p->name);
		t=p->name;
		for(j=0;j<s;j++)
		{
			d=t[j]-64;
			a[d]++;
			b[d][a[d]-1]=p->num;
		}
	}
	for(i=1;i<=26;i++)
	{
		for(j=1,f=0;j<=26;j++)
		{
		    if(a[i]<a[j])
			{
				f=1;
				break;
			}
		}
		if(f==0)
			break;
	}
	return i;
}
void main ()
{
	struct stu *head;
	int i,j,n;
	scanf("%d",&n);
	head=creat(n);
	i=check(head,n);
	printf("%c\n%d\n",i+64,a[i]);
	for(j=0;j<a[i];j++)
		printf("%d\n",b[i][j]);

}
int main()
{
    int m,i,j,a[1000],c[91]={0},k,n,p=0;
    char b[1000][26],q;
    scanf("%d", &m);
    for(i=1;i<=m;i++)
    {
                     scanf("%d%s", &a[i], b[i]);
                     n=strlen(b[i]);
                     for(j=0;j<=n-1;j++)
                     {
                                        k=b[i][j];
                                        c[k]++;
                     }
    }
    for(i=65;i<91;i++) if(c[i]>p) {p=c[i]; q=i;}
    printf("%c\n%d\n", q, p);
    for(i=1;i<=m;i++)
    {
                     n=strlen(b[i]);
                     for(j=0;j<=n-1;j++) if(b[i][j]==q) printf("%d\n", a[i]);
    }
    return 0;
}
struct BOOK{
	int id;
	int author[26];
};
int main(){
	struct BOOK book[1000];
	int countauthor[26];
	int n,i,j,minusA,no,count,max=0,maxau;
	char input[30];
	scanf("%d",&n);
	for(i=0;i<n;i++){
		for(j=0;j<26;j++){
			book[i].author[j]=0;
		}
	}// refresh data: each book-->all authors initiate with 0
	for(i=0;i<n;i++){
		scanf("%d",&book[i].id);
		scanf("%s",&input);
		no=strlen(input);
		for(j=0;j<no;j++){			
			minusA=(input[j]-'A');
			book[i].author[minusA]++;
		}
	}
	for(i=0;i<26;i++){
		count=0;
		for(j=0;j<n;j++){
			if(book[j].author[i]==1)
				count++;
		}
		countauthor[i]=count;
	}
	for(i=0;i<26;i++){
		if(max<countauthor[i])
			max=countauthor[i];
	}// to find max
	for(i=0;i<26;i++){
		if(countauthor[i]==max)
			maxau=i;
	}//to find which author	has maximum number of book	
	printf("%c\n%d\n",(maxau+'A'),max);
	for(i=0;i<n;i++){
		if(book[i].author[maxau]==1){
			printf("%d\n",book[i].id);
		}
	}
	return 0;
}
int main()
{
    int a;
	scanf("%d",&a);
	char zuozhe[100][100];
	int shuhao[100];
	int zuo[200];
	int shu[200][200];
	int n=0,p,i,j;
	int m[200];
	
	for(i=0;i<200;i++)
	{  zuo[i]=0;
	   m[i]=0;
	}
	
	for(i=0;i<a;i++)
	{
		scanf("%d %s",&shuhao[i],zuozhe[i]);
	}
	for(i=0;i<a;i++)
	{
		for(j=0;(zuozhe[i][j])!='\0';j++)
		{  
			zuo[(zuozhe[i][j])]=zuo[(zuozhe[i][j])]+1;
			shu[(zuozhe[i][j])][(m[(zuozhe[i][j])])]=shuhao[i];
			m[(zuozhe[i][j])]=m[(zuozhe[i][j])]+1;
		}
	}
    for(i=65;i<=90;i++)
	{
		if(zuo[i]>n)
		{
			n=zuo[i];
			p=i;
		}
	}
	printf("%c\n",p);
	printf("%d\n",zuo[p]);
	for(i=0;i<m[p];i++)
	{
		printf("%d\n",shu[p][i]);
	}

	return 0;
}
int main(int argc, char* argv[])
{
	struct {
		int a;
		char b[26];
	}num[999];
	int i,m,j,k;
	int s[26];

	scanf ("%d",&m);
	for (i=0;i<m;i++)
	{
		scanf ("%d%s",&num[i].a,num[i].b);
	}
	for (k=0;k<26;k++)
	{
		s[k]=0;
	}


	for (i=0;i<m;i++)
	{
		for (j=0;num[i].b[j]!='\0';j++)
		{
			k=num[i].b[j]-'A';
			s[k]++;
		}
	}
	int first=s[0];
	int t;
	for (k=0;k<26;k++)
	{
		if (s[k]>first)
		{
			first=s[k];
			t=k;
		}
	}
	printf ("%c\n",t+'A');
	printf ("%d\n",first);
	for (i=0;i<m;i++)
	{
		for (j=0;num[i].b[j]!='\0';j++)
		{
			if (num[i].b[j]==(t+'A'))
			{
				printf ("%d\n",num[i].a);
			}
		}
	}
	return 0;
}
int main(){
	int max,max1,t,k,x[28]={0},n,a,b,c,d,i,j;
	char cc,y[100][32],q;
	scanf("%d",&n);
	scanf("%c",&cc);
	for(i=1;i<=n;i++){
		gets(y[i]);
		for(j=2;y[i][j];j++){
			if(y[i][j]>='A'&&y[i][j]<='Z'){
				x[y[i][j]+1-'A']++;}
		}}
	max=x[1];
	max1=1;
	for(i=2;i<=26;i++){
		if(x[i]>max){
			max=x[i];
			max1=i;}}
	q='A'-1+max1;
	printf("%c\n",q);
	printf("%d\n",max);
	for(i=1;i<=n;i++){
		for(j=2;y[i][j];j++){
			if(y[i][j]==q){
				for(t=0;y[i][t];t++){
					if(y[i][t]==' ')break;
					else printf("%c",y[i][t]);
				}
				printf("\n");
			break;
			}
		}
	}
}
void main()
{
	int n,a[1000]={0},c[27]={0},i,j,k,m,p,d[1000]={0};
	char b[1000][30]={{0}};
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d %s",&a[i],b[i]);
	}
	
	for(i=0;i<n;i++)
	{
		for(j=0;j<26;j++)
		{
			for(k=1;k<=26;k++)
			{
				if(b[i][j]==64+k)c[k]=c[k]+1;
			}
		}
	}
	
	m=c[1];
	p=1;
	for(i=1;i<27;i++)
	{
		if(c[i]>m)
		{
			m=c[i];
			p=i;
		}
	}
	
	for(i=0;i<n;i++)
	{
		for(j=0;j<26;j++)
		{
			if(b[i][j]==64+p)d[i]=1;
			
		}
	}
	printf("%c\n",64+p);
	printf("%d\n",m);
	for(i=0;i<1000;i++)
	{
		if(d[i]==1)printf("%d\n",a[i]);
	}
}
int main()
{
	int m,i,j,max=0;
	int Q[26]={0};
	struct
	{
		int num;
		char name[27];
	}book[1000];
	scanf("%d",&m);
	for(i=0;i<m;i++)
		scanf("%d %s",&book[i].num,book[i].name);
	for(i=0;i<m;i++)
	{
		for(j=0;j<strlen(book[i].name);j++)
		{
			switch(book[i].name[j])
			{
				case 'A':
				Q[0]++;
				break;
				case 'B':
				Q[1]++;
				break;
				case 'C':
				Q[2]++;
				break;
				case 'D':
				Q[3]++;
				break;
				case 'E':
				Q[4]++;
				break;
				case 'F':
				Q[5]++;
				break;
				case 'G':
				Q[6]++;
				break;
				case 'H':
				Q[7]++;
				break;
				case 'I':
				Q[8]++;
				break;
				case 'J':
				Q[9]++;
				break;
				case 'K':
				Q[10]++;
				break;
				case 'L':
				Q[11]++;
				break;
				case 'M':
				Q[12]++;
				break;
				case 'N':
				Q[13]++;
				break;
				case 'O':
				Q[14]++;
				break;
				case 'P':
				Q[15]++;
				break;
				case 'Q':
				Q[16]++;
				break;
				case 'R':
				Q[17]++;
				break;
				case 'S':
				Q[18]++;
				break;
				case 'T':
				Q[19]++;
				break;
				case 'U':
				Q[20]++;
				break;
				case 'V':
				Q[21]++;
				break;
				case 'W':
				Q[22]++;
				break;
				case 'X':
				Q[23]++;
				break;
				case 'Y':
				Q[24]++;
				break;
				case 'Z':
				Q[25]++;
				break;
			}
		}
	}
	for(i=1;i<26;i++)
	{
		if(Q[i]>Q[max])
			max=i;
	}
	printf("%c\n%d\n",max+65,Q[max]);
	for(i=0;i<m;i++)
	{
		for(j=0;j<strlen(book[i].name);j++)
		{
			if(book[i].name[j]==max+65)
			{
				printf("%d\n",book[i].num);
				break;
			}
		}
	}
	return 0;
}
struct book{
	char a[1000];
    char b[26];
}book[1000];
int main()
{
 int m,i,j,s,k,p,l;
 int t[26]={0};
 char x;
 scanf("%d",&m);
 for(i=0;i<m;i++)
 scanf("%s %s",&book[i].a,book[i].b);
 for(i=0;i<m;i++)
 {
	 s=strlen(book[i].b);
	 for(j=0;j<s;j++)
	 {
		 x=book[i].b[j];
		 k=x;
		 t[k-65]=t[k-65]+1;
	 }
 }
 p=t[0];
 l=0;
 for (i=1;i<26;i++)
 {
	 if(t[i]>p)
	 {
		 p=t[i];
		 l=i;
	 }
 }
 x=l+65;
 printf("%c\n",x);
 printf("%d\n",p);
for(i=0;i<m;i++)
 {
	 s=strlen(book[i].b);
	 for(j=0;j<s;j++)
	 {
		 if(book[i].b[j]==x)
		 {
			 printf("%s\n",book[i].a);
		 }
	 }
}
return 0;
}
struct j
{
	int bianhao;
	char zuozhe[100];
};
main()
{
	int m,i,l,k,z,max=0;
	int shumu[26];
	scanf("%d",&m);
	struct j * a;
	a=(struct j *)malloc(m*sizeof(j));
	for(i=0;i<m;i++)
	{
		scanf("%d %s",&a[i].bianhao,a[i].zuozhe);
	}
	for(z=0;z<26;z++)
	{
		shumu[z]=0;
	for(i=0;i<m;i++)
	{
		char * p;
		p=a[i].zuozhe;
		l=strlen(a[i].zuozhe);
		for(k=0;k<l;k++)
		{
			if(p[k]=='A'+z)
				shumu[z]++;
		}
	}

    }
     for(z=0;z<26;z++)
	 {
        if(shumu[z]>max)
			max=shumu[z];
	 }
	 for(z=0;z<26;z++)
	 {
		 if(shumu[z]==max)
		 {
	
			 printf("%c\n%d\n",z+'A',max);
			 for(i=0;i<m;i++)
	{
		char * p;
		p=a[i].zuozhe;
		l=strlen(a[i].zuozhe);
		for(k=0;k<l;k++)
		{
			if(p[k]=='A'+z)
				printf("%d\n",a[i].bianhao);
		}
	}
			 break;
		 }
	 }

}
//#define NULL 0
struct stu
{
	int num;
	char c[26];
	struct stu *next;
};

struct stu* create(int m)
{
	struct stu *p1,*p2,*xhead;
	p1=(struct stu *)malloc(LEN);
	scanf("%d %s",&p1->num,p1->c);
	p2=p1;
	xhead=p1;

	while(m-1)
	{
		m--;
		p1=(struct stu*)malloc(LEN);
		scanf("%d %s",&p1->num,p1->c);
		p2->next=p1;
		p2=p1;
	}
	p2->next=NULL;
	return xhead;
}

int stas(int b[])
{
		int j,max=0,indexx=0;
		for(j=0;j<26;j++)
		if(b[j]>max)
		{
			max=b[j];
			indexx=j;
		}
	printf("%c\n%d\n",indexx+65,max);
	//for(j=0;j<26;j++)
		//printf("%d ",b[j]);
	return indexx;
}

struct stu* search(struct stu* yhead,int y)
{
	struct stu *q;
	int sum=0,k;
	char *i;
	char s[20],s0[20]={'\0'};
	q=yhead;
	while(q)
	{
		strcpy(s,q->c);
		k=strlen(s);
		for(i=s;i<i+k;i++)
			if(*i==y+65)
				sum++;
		strcpy(s,s0);
		q=q->next;
	}
	printf("%d\n",sum);
	return 0;
}

struct stu* print(struct stu* zhead,int z)
{
	struct stu* q;
	int k;
	char *i;
	char s[20],s0[20]={'\0'};
	q=zhead;
	while(q)
	{
		strcpy(s,q->c);
		k=strlen(s);
		for(i=s;i<s+k;i++)
			if(*i==z+65)
			{
				printf("%d\n",q->num);
				break;
			}
		strcpy(s,s0);
		q=q->next;
	}
	return 0;
}

int main()
{
	int n,index;
	int a[26],k,t,i;
	char s[20],s0[20]={'\0'};
	struct stu *p,*head;
	memset(a,0,sizeof(a));

	scanf("%d",&n);
	head=create(n);
	p=head;
	while(p)
	{
		strcpy(s,p->c);
		//printf("%s ",s);
		k=strlen(s);
		//printf("%d ",k);
		for(i=0;i<k;i++)
		{
			//printf("%c ",s[i]);
			t=s[i]-65;
			a[t]++;
		}
		//for(t=0;t<26;t++)
			//printf("%d ",a[t]);
		strcpy(s,s0);
		p=p->next;
	}

	index=stas(a);
	//search(head,index);
	print(head,index);
	return 0;
}