semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	int book[1000], m, i, j, k, length, max = 0, name[500] = {0}; 
	char writer[1000][26], name1;
	cin >> m;
	for (i = 0; i < m; i++)
		cin >> book[i] >> writer[i];
	for (k = 'A'; k <= 'Z'; k++)
	{
		for (i = 0; i < m; i++)
		{
			length = strlen(writer[i]);
			for (j = 0; j < length; j++)
				if (writer[i][j] == k)
					name[k]++;
		}
		if (name[k] > max)
		{
			max = name[k];
			name1 = k;
		}
	}
	cout << name1 << endl;
	cout << max << endl;
	for (i = 0; i <= m; i++)
	{
		length = strlen(writer[i]);
		for (j = 0; j <= length; j++)
			if (writer[i][j] == name1)
				cout << book[i] << endl;
	}

	return 0;
}
int main()
{ 
	int record[26][1000];
	memset(record,0,sizeof(record));
	char name[10];
	int m,temp;
	cin>>m;
	for (int i=0;i<m;i++)
	{
		cin>>temp;
		cin.get();
		cin.getline(name,10);
		for (int i=0;i<strlen(name);i++)
		{
			record[name[i]-65][record[name[i]-65][0]+1]=temp;
			record[name[i]-65][0]++;
		}
	}
	int flag=0;
	for (int i=0;i<25;i++)
	{
		if (record[i][0]>record[flag][0])
		{
			flag=i;
		}
	}
	cout<<(char)(flag+65)<<endl<<record[flag][0]<<endl;
	for (int i=1;i<=record[flag][0];i++)
	{
		cout<<record[flag][i]<<endl;
	}

	return 0;
}
struct book
{
	char num[4]; 
	char author[27];
}book[100];
int main()
{  
	int n,i,k,sz[26],t,m,e;
	scanf("%d",&n);
	m=0;
	for(i=0;i<26;i++){
		sz[i]=0;
	}
	for(i=0;i<n;i++){
		scanf("%s%s",book[i].num,book[i].author);
		t=strlen(book[i].author);
		for(k=0;k<t;k++){
				sz[book[i].author[k]-'A']++;
		}
	}for(i=0;i<26;i++){
		if(sz[i]>m){
			m=sz[i];
			e=i;
		}
	}printf("%c\n%d\n",e+'A',m);
	for(i=0;i<n;i++){
		t=strlen(book[i].author);
		for(k=0;k<t;k++){
			if(book[i].author[k]==e+'A'){
				printf("%s\n",book[i].num);
			}
		}
	}return 0;
}
main()
{
	int n;
	scanf("%d",&n);
	struct 
	{
		int num;
		char a[25];
	}book [999];
	int i,j;
	for(i=0;i<=n-1;i++)
	{
		scanf("%d %s",&book[i].num,book[i].a);
	}
	int s[26]={0};
	for(i=0;i<=n-1;i++)
	{
		int len=strlen(book[i].a);
		for(j=0;j<len;j++)
		{
			s[book[i].a[j]-'A']++;
		}
	}
	int max=0;
	char name;
	for(i=0;i<=25;i++)
	{
		if(s[i]>max)
		{
			max=s[i];
			name='A'+i;
		}
	}
	printf("%c\n",name);
	printf("%d\n",max);
	for(i=0;i<=n-1;i++)
	{
		int len=strlen(book[i].a);
		for(j=0;j<len;j++)
		{
			if(book[i].a[j]==name)
				printf("%d\n",book[i].num);
		}
	}




		
	
}
struct book{
	int num1;
	char au[27];
}bk[1000];
struct author{
	char name;
	int a;
	int num2[1000];
}aur[27];
int main()
{
	int n,i,j;
	struct author max;
	max.a=0;
	
	for(j=0;j<26;j++){
		aur[j].name=65+j;
		aur[j].a=0;
		}
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d %s",&bk[i].num1,bk[i].au);
	}
	//??????,?????
	for(i=0;i<n;i++){
		for(j=0;bk[i].au[j]!='\0';j++){
			aur[bk[i].au[j]-65].num2[aur[bk[i].au[j]-65].a]=bk[i].num1;
			aur[bk[i].au[j]-65].a++;
		}
	}
	//??????????
	for(i=0;i<26;i++){
		if(aur[i].a>max.a)max=aur[i];
	}
	printf("%c\n%d\n",max.name,max.a);
	for(i=0;i<max.a;i++){
		printf("%d\n",max.num2[i]);
	}
	return 0;
}
struct book
{
    int num;
	char name[26];
	struct book *next;
};

struct book *creat(int n)
{
	int i;
	struct book *head;
	struct book *p1,*p2;
	p1=p2=(struct book *)malloc(LEN);
	scanf("%d %s",&p1->num,p1->name);
	head=NULL;
	
	for(i=0;i<n-1;i++)
	{
	
		if(i==0)head=p1;
		p1=(struct book*)malloc(sizeof(struct book));
		scanf("%d %s",&p1->num,p1->name);
		p2->next=p1;
		p2=p1;
	}
	p2->next=NULL;
	return (head);
}

void main()
{
	int i,n,a[26]={0},max=0,j,k=0;
	char t;
	struct book *p,*p1;
	scanf("%d",&n);
	p=creat(n);
	p1=p;
	for(j=0;j<n;j++)
	{
		for(i=0;*(p->name+i)!='\0';i++)
			a[*(p->name+i)-65]=a[*(p->name+i)-65]+1;
        p=p->next;
	}
	for(i=0;i<26;i++)
	{
		if(a[i]>max){max=a[i];k=i;}
	}
	printf("%c\n%d\n",(k+65),max);
	t=(char)(k+65);

	while(p1!=NULL)
	{
		for(i=0;*(p1->name+i)!='\0';i++)
		{
			if(*(p1->name+i)==t)
			{
				printf("%d\n",p1->num);
				break;
			}
		}
		p1=p1->next;
	}
}
struct book
{
	int num;
	char str[26];
}bk[1000];
void main()
{
	int m,i,j,k,s,n=0;
	char a[26]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','R','S','T','U','V','W','X','Y','Z'};
	int b[26]={0};
	scanf("%d",&m);
    for(i=0;i<m;i++)
		scanf("%d %s",&bk[i].num,bk[i].str);
	for(i=0;i<m;i++)
		for(j=0;j<strlen(bk[i].str);j++)
			for(k=0;k<26;k++)
				if(a[k]==bk[i].str[j])
					b[k]++;
				for(i=0;i<26;i++)
					if(b[i]>n)
					{
						n=b[i];
						s=i;
					}
					printf("%c\n%d\n",a[s],b[s]);
					for(i=0;i<m;i++)
						for(j=0;j<strlen(bk[i].str);j++)
							if(bk[i].str[j]==a[s])
								printf("%d\n",bk[i].num);
}
int main()
{
    int m,shu[1000],num[26],length[1000];
    char author[1000][26],maxauthor;
    cin>>m;
    memset(num,0,sizeof(num));
    for(int i=0;i<m;i++)
    {
      cin>>shu[i]>>author[i];
      length[i]=strlen(author[i]);
      for(int j=0;j<length[i];j++)//?????????? 
      num[author[i][j]-'A']+=1;
    }
    int maxnum=0;
    for(int i=0;i<26;i++)
    {
      if(maxnum<num[i])
      maxnum=num[i];//??????????? 
    }
    for(int i=0;i<26;i++)
    {
      if(num[i]==maxnum)//??????????? 
      {
         maxauthor=(char)('A'+i);
         cout<<maxauthor<<endl;
         cout<<maxnum<<endl;
         break;
      }
    }
    for(int i=0;i<m;i++)
    {
      for(int j=0;j<length[i];j++)
      {
         if(author[i][j]==maxauthor)//???????? 
         cout<<shu[i]<<endl;
      }
    } 
    return 0;
}
struct book
{
	int number;
	char name[26];
	int num[26];
}; 
void mostbook(struct book *p)
{
   int i,j,k;
   k=strlen(p->name);
   for(j=0;j<26;j++)			//???num???
   {
	   p->num[j]=0;
   }
   for(i=0;i<k;i++)
		 (p->num[(p->name[i]-'A')])++;
}


void main()
{
   int i,j,m;
   int max=0;
   int maxi=0;
   int s[26]={0};
   //printf("???????:\n");
   scanf("%d",&m);
   struct book *p;
   p=(struct book *)malloc(m*sizeof(struct book));
      for(i=0;i<m;i++)
   {
	 // printf("????????\n");
      scanf("%d",&(p+i)->number);
	  scanf("%s",&(p+i)->name);
	  mostbook(p+i);
      for(j=0;j<26;j++)
	    s[j]+=((p+i)->num[j]);
	}
   for(i=0;i<26;i++)
   {
	   if(s[i]>=max)
	 {
		 max=s[i];
         maxi=i;
	 }
   }
   //printf("????????\n");
   printf("%c\n",(maxi+'A'));
   //printf("?????\n");
   printf("%d\n",max);
   //printf("?????\n");
   for(i=0;i<m;i++)
   {
	  int k,j;
	  k=strlen((p+i)->name);             //??i?book??
	  for(j=0;j<k;j++)
	  {
		 if((p+i)->name[j]==(maxi+'A'))  //??i?book??
		 {
			 printf("%d\n",(p+i)->number);
			 continue;				//????????????????continue
		 }
	  }
   }

}
struct book{
       int  num;
       char writer[28];
}bo[1000];
int main()
{
    int i,j,k,n,a,b;
    int max=0;
    scanf("%d",&n);
    for(i=0;i<n;i++){
       scanf("%d %s",&bo[i].num,bo[i].writer);
       }
    for(i='Z';i>='A';i--){
        a=0;
        for(k=0;k<n;k++){
            for(j=0;j<27;j++){
                if(bo[k].writer[j]==i){
                   a++;
                  }
               }
           }
        if(a>max){
           max=a;
           b=i;
          }
       }
     printf("%c\n%d\n",b,max);
     for(j=0;j<n;j++){
         for(i=0;i<28;i++){
             if(bo[j].writer[i]==b){
                printf("%d\n",bo[j].num);
               }
            }
        }
     return 0;
}
struct Books
{
	int num;
	char author[26];
}a[1000];

int main()
{
	int n;
	int i,j;
	int x;
	int max=0;
	char letter='A';
	int b[26]={0};
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d %s",&a[i].num,a[i].author);
	}//??a[];
	for(i=0;i<n;i++)
	{
		for(j=0;;j++)
		{
			if(a[i].author[j]>=65 && a[i].author[j]<=90)
			{
				x=a[i].author[j];//x:65-90
				b[x-65]++;
			}else{
				break;
			}
		}
	}//?????
//	for(i=0;i<26;i++)
//	{
//		printf("%d\n",b[i]);
//	}
	for(i=0;i<26;i++)
	{
		if(b[i]>max)
		{
			max=b[i];
			letter=i+65;
		}
	}
	printf("%c\n%d\n",letter,max);
	for(i=0;i<n;i++)
	{
		for(j=0;j<26;j++)
		{
			if(a[i].author[j]==letter)
			{
				printf("%d\n",a[i].num);
			}
		}
	}
	return 0;
}
void main()
{
	int n,i,j,max=0;
	scanf("%d",&n);
	int num[1000];
	int sum[26];
	for(i=0;i<26;i++){
		sum[i]=0;
	}
	char a[1000][27];
	for(i=0;i<n;i++){
		scanf("%d %s",&num[i],a[i]);
	}
	for(i=0;i<n;i++){
		for(j=0;a[i][j]!='\0';j++){
			sum[a[i][j]-'A']=sum[a[i][j]-'A']+1;
		}
	}
	for(i=1;i<26;i++){
		if(sum[i]>sum[max]){
			max=i;
		}
	}

	printf("%c\n",max+'A');
	printf("%d\n",sum[max]);
	for(i=0;i<n;i++){
		for(j=0;a[i][j]!='\0';j++){
			if(a[i][j]==max+'A'){
				printf("%d\n",num[i]);
				break;
			}
		}
	}
}
int main(){
	int n,i,j,k,z;
    char max;
	int sum[999]={0};
    struct student{
           int a;
           char b[26];
           int c[26];
                   }x[999];
    scanf("%d\n",&n);
    for(i=0;i<n;i++){
                     scanf("%d ",&x[i].a);
                     for(j=0;;j++){
                             scanf("%c",&x[i].b[j]);
                             if(x[i].b[j]=='\n')
                             break;
                             x[i].c[x[i].b[j]-65]++;}
                             }
    for(k=0;k<26;k++){
                      for(i=0;i<999;i++){
                                        sum[k]=sum[k]+x[i].c[k];
                                        }
                                        }
                                        
    z=sum[0];
    max=65;
    for(k=1;k<26;k++){
                      if(sum[k]>z){
                                          max=k+65;
                                          z=sum[k];
                                          }
                                          }
    printf("%c\n",max);
    printf("%d\n",z);
    for(i=0;i<n;i++){
                     if(x[i].c[max-65]>0){
                                          printf("%d\n",x[i].a);
                                          }
                                          }
                             
	scanf("%d",i);
return 0;}
int main()
{
	int i,j,n,x[1000],a[26],b,c,num=0;
	char s[1000][26];
	for(i=0;i<25;i++)
		a[i]=0;
	cin>>n;
	for(i=0;i<n;i++)
	{
		cin>>x[i]>>s[i];
		for(j=0;s[i][j]!='\0';j++)
			a[(int)s[i][j]-65]++;
	}
	b=a[0];
	c=0;
	for(i=1;i<26;i++)
		if(b<a[i])
		{
			b=a[i];
			c=i;
		}
	cout<<(char)(c+65)<<endl;
	for(i=0;i<n;i++)
		for(j=0;s[i][j]!='\0';j++)
			if(s[i][j]==(char)c+65)
				num++;
	cout<<num<<endl;
	for(i=0;i<n;i++)
		for(j=0;s[i][j]!='\0';j++)
			if(s[i][j]==(char)c+65)
			{
				cout<<x[i]<<endl;
				break;
			}
	return 0;
}
int cishu[26];

struct shu
{
	int num;
	char name[26];
	struct shu *next;
};

struct shu *app(int n)
{
	int i,len,j;
	struct shu *newnode ,*p, *head;
	for(i=1;i<=n;i++)
	{
		newnode=(struct shu *)malloc(sizeof(struct shu));
		scanf("%d %s", &newnode->num , newnode->name );
		len=strlen(newnode->name );
	
		for(j=0;j<len;j++)
		{
			cishu[newnode->name[j]-'A']++;
		}

		if(i==1)
		{
			head=newnode;
		}
		else
		{
			p->next =newnode;
		}
		p=newnode;
	}
	p->next =0;
	return head;
}

int max(void)
{
	int m=0, i ,x;
	for(i=0;i<26;i++)
	{
		if(cishu[i]>m)
		{m=cishu[i];
		x=i;}
	}
	return x;
}

int cunzai(char a[],int kk)
{
	int l,i;
	l=strlen(a);
	for(i=0;i<l;i++)
	{
		if(a[i]==kk+'A')
			return 1;
	}
	return 0;
}


int main()
{
	int n,kk;
	struct shu *head, *p;
	scanf("%d",&n);

	head=app(n);
	kk=max();
	printf("%c\n%d\n", 'A'+kk, cishu[kk]);

	for(p=head;p!=0;p=p->next )
	{
		if(cunzai(p->name ,kk))
		{printf("%d\n",p->num );}
	}
	return 0;
}
struct chs{
	char zz[27];
	int num;
}cs[],*p;
int main(){
	int n;
	scanf("%d",&n);
	struct chs *cs=(struct chs *)malloc(sizeof(struct chs)*n);
	for(p=cs;p<cs+n;p++){
		scanf("%d%s",&(p->num),p->zz);
	}
	int l,a,zm[26],*z;
	for(z=zm;z<zm+26;z++){
		*z=0;
	}
	char *q;
	for(p=cs;p<cs+n;p++){
		l=strlen(p->zz);
		for(q=p->zz;*q!='\0';q++){
			a=(int)(*q);
			(*(zm+a-65))++;
		}
	}
	int max=0;
	for(z=zm;z<zm+26;z++){
		if(*z>*(zm+max)){
			max=z-zm;
		}
	}
	printf("%c\n%d\n",(char)(max+65),*(zm+max));
	for(p=cs;p<cs+n;p++){
		l=strlen(p->zz);
		for(q=p->zz;*q!='\0';q++){
			a=(int)(*q);
			if((a-65)==max){
				printf("%d\n",p->num);
			}
		}
	}
	free(cs);
	return 0;
}
int main()
{
	int n;
	scanf("%d",&n);
	if(n>0){
	struct a
	{
		char y[30];
		int x,l; 
	}a[1000];
	struct b
	{
		char y;
		int x; 
	}b[26];
	int i,j,p;
	char k;
	for(i=0;i<n;i++)
	{
		scanf("%d %s",&a[i].x,&a[i].y);
		a[i].l=strlen(a[i].y);
	}
	for(i=0;i<=25;i++)
	{
		b[i].y=i+65;
		b[i].x=0;
	}
	for(i=0;i<n;i++)
	{
		for(j=0;j<a[i].l;j++)
		{
			for(k=65;k<=90;k++)
			{
				if(a[i].y[j]==k)b[k-65].x=b[k-65].x+1;	
			}
		}
	}
	int max=b[0].x;
	for(i=0;i<=25;i++)
	{
		if(b[i].x>max)max=b[i].x;
	}
	for(i=0;i<=25;i++)
	{
		if(b[i].x==max)
		{
			printf("%c\n",b[i].y);
			printf("%d\n",b[i].x);
			for(j=0;j<n;j++)
			{
				for(p=0;p<a[j].l;p++)
				{
					if(a[j].y[p]==b[i].y)
					{printf("%d\n",a[j].x);break;}
				}
			}
			break;
		}
	}
	}
	return 0;
}
int main(){
	int n[26]={0};
	char z[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'};
	char nn[26][100][20];
	int m,i,j,r;
	char a[100][100];
	scanf("%d",&m);
	for(j=0;j<m;j++){
		scanf("%s",a[j]);
		char b[20];
		scanf("%s",b);
		int w=strlen(b);
		for(i=0;i<w;i++){
			for(r=0;r<26;r++){
				if(b[i]==z[r]){
					n[r]++;
					strcpy(nn[r][n[r]],a[j]);
				}
			}
		}
	}
		int c=0;
		for(r=1;r<26;r++){
			if(n[r]>n[c])
				c=r;
		}
		printf("%c\n%d\n",z[c],n[c]);
		for(i=1;i<=n[c];i++){
			printf("%s\n",nn[c][i]);
		}
	}
int main()
{
	int n;
	cin>>n;
	int book[1000];
	char author[1000][10];
	int i,j;
	for(i=0;i<n;i++){
		cin>>book[i]>>author[i];
	}
	int num[26]={0};
	for(i=0;i<n;i++){
		int length;
		length=strlen(author[i]);
		for(j=0;j<length;j++){
			num[author[i][j]-'A']++;
		}
	}
	int max=0;
	char maxi;
	for(i=0;i<26;i++){
		if(num[i]>max){
			max=num[i];
			maxi='A'+i;
		}
	}
	cout<<maxi<<endl;
	int sum=0;
	for(i=0;i<n;i++){
		int length;
		length=strlen(author[i]);
		for(j=0;j<length;j++){
			if(author[i][j]==maxi){
				sum++;
			}
		}
	}
	cout<<sum<<endl;
	for(i=0;i<n;i++){
		int length;
		length=strlen(author[i]);
		for(j=0;j<length;j++){
			if(author[i][j]==maxi){
				cout<<book[i]<<endl;
			}
		}
	}
	return 0;
}
int main()
{
int m,i,j,k=0;
struct
{int n;
 char s[26];
}book[999];
scanf("%d",&m);
for(i=0;i<m;i++)
  scanf("%d %s",&book[i].n,&book[i].s);
int a[26]={0};
for(i=0;i<m;i++)
 for(j=0;book[i].s[j]!='\0';j++)
	 a[(int)(book[i].s[j]-'A')]++;
for(i=1;i<26;i++)
 if(a[k]<a[i])
 k=i;
printf("%c\n%d\n",k+'A',a[k]);
for(i=0;i<m;i++)
 for(j=0;book[i].s[j]!='\0';j++)
	 if(book[i].s[j]==k+'A')
	 {
		 printf("%d\n",book[i].n);
	 break;
	 }
}
int main()
{
	int num[110],m,ni = 0,n = 0,maxn[30]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
	char au[110][30],max[30];
	cin >> m;
	
		int i,j;
		for (i = 0; i < m; i ++)
		{
			cin >> num[i];
			cin >> au[i];
		}
		for (i = 0; i < m; i ++)
		{
			for (j = 0; au[i][j] != '\0';j++)
			{
				if (au[i][j] == 'A')  maxn[0] ++;
				if (au[i][j] == 'B')  maxn[1] ++;
				if (au[i][j] == 'C')  maxn[2] ++;
				if (au[i][j] == 'D')  maxn[3] ++;
				if (au[i][j] == 'E')  maxn[4] ++;
				if (au[i][j] == 'F')  maxn[5] ++;
				if (au[i][j] == 'G')  maxn[6] ++;
				if (au[i][j] == 'H')  maxn[7] ++;
				if (au[i][j] == 'I')  maxn[8] ++;
				if (au[i][j] == 'J')  maxn[9] ++;
				if (au[i][j] == 'K')  maxn[10] ++;
				if (au[i][j] == 'L')  maxn[11] ++;
				if (au[i][j] == 'M')  maxn[12] ++;
				if (au[i][j] == 'N')  maxn[13] ++;
				if (au[i][j] == 'O')  maxn[14] ++;
				if (au[i][j] == 'P')  maxn[15] ++;
				if (au[i][j] == 'Q')  maxn[16] ++;
				if (au[i][j] == 'R')  maxn[17] ++;
				if (au[i][j] == 'S')  maxn[18] ++;
				if (au[i][j] == 'T')  maxn[19] ++;
				if (au[i][j] == 'U')  maxn[20] ++;
				if (au[i][j] == 'V')  maxn[21] ++;
				if (au[i][j] == 'W')  maxn[22] ++;
				if (au[i][j] == 'X')  maxn[23] ++;
				if (au[i][j] == 'Y')  maxn[24] ++;
				if (au[i][j] == 'Z')  maxn[25] ++;
			}
		}
		for (i = 0; i < 26; i ++)
		{
			if (maxn[i] > n) {n = maxn[i];ni = i;}
		}
		cout << (char)(ni+65) << endl;
		cout << n << endl;
		for (i = 0 ; i < m; i ++)
		{
			for ( j = 0;au[i][j] != '\0';j ++)
			{
				if (au[i][j] == 65+ni)  cout << num[i] << endl;
			}
		}
	
	return 0;
}
struct book
{
       char num[4];
       char author[26];
}book[999];
int main()
{
    int n;
    scanf ("%d", &n);
    int i,j;
    int a;
    char c;
    int max=0;
    for (i=0;i<=n-1;i++)
    {
        scanf ("%s %s", &book[i].num, book[i].author);
    }
    int s[26];
    for (i=0;i<=25;i++)
    {
        s[i]=0;
    }
    for (i=0;i<=n-1;i++)
    {
        for (j=0;j<=25;j++)
        {
            if (0<=(book[i].author[j]-'A')&&(book[i].author[j]-'A')<=25)
            {
                                                                        a=book[i].author[j]-'A';
                                                                        s[a]=s[a]+1;
            }
        }
    }
    
    for (i=0;i<=25;i++)
    {
        if (max<s[i])
        {
                     max=s[i];
        }
    }
    for (i=0;i<=25;i++)
    {
        if (max==s[i])
        {
                      c='A'+i;
        }
    }
    printf ("%c\n", c);
    printf ("%d\n", max);
    for (i=0;i<=n-1;i++)
    {
        for (j=0;j<=25;j++)
        {
            if (book[i].author[j]==c)
            {
                                     printf ("%s\n", book[i].num);
            }
        }
    }                                                                                
    
    return 0;
}
void main()
{
	int i,j,k,n,max;
	int a[1000],b[26];
	char name[1000][26];
	scanf("%d",&n);
	for(i=0;i<26;i++)
		b[i]=0;
	for(i=0;i<n;i++){
		scanf("%d%s",&a[i],name[i]);
		for(j=0;j<strlen(name[i]);j++)
			b[name[i][j]-'A']++;
	}
	max=0;
	for(k=1;k<26;k++)
		if(b[k]>b[max])
			max=k;
	printf("%c\n%d\n",max+'A',b[max]);
	for(i=0;i<n;i++)
		for(j=0;j<strlen(name[i]);j++)
			if(name[i][j]==max+'A'){
				printf("%d\n",a[i]);
				break;
			}
}
struct book
{
	int number;
	char writer[26];
	struct book *next;
}

main()
{
	int n,i,j,num[26]={0},nu[26],a,b;
	struct book *head,*p1,*p2;
	scanf("%d",&n);
	p1=p2=(struct book *)malloc(LEN);
	for(i=0;i<n;i++)
	{
		scanf("%d%s",&p1->number,&p1->writer);
		for(j=0;j<strlen(p1->writer);j++)
		{
			++num[p1->writer[j]-65];
		}
		if(i==0)
			head=p1;
		else
			p2->next=p1;
		p2=p1;
		p1=(struct book *)malloc(LEN);
	}
	p2->next=NULL;
	for(i=0;i<26;i++)
	{
		nu[i]=i;
	}
	for(i=0;i<25;i++)
	{
		for(j=0;j<25-i;j++)
		{
			if(num[j]<num[j+1])
			{
				a=nu[j];
				nu[j]=nu[j+1];
				nu[j+1]=a;
				b=num[j];
				num[j]=num[j+1];
				num[j+1]=b;
			}
		}
	}
	printf("%c\n%d\n",nu[0]+65,num[0]);
	for(i=0;i<n;i++)
	{
		for(j=0;j<strlen(head->writer);j++)
		{
			if(head->writer[j]==(char)nu[0]+65)
			{
				printf("%d\n",head->number);
				break;
			}
		}
		head=head->next;
	}
}
struct bo{
	char id[10];
	char au[100];
};

int main(){
	int n,i,j,max;
	char maxa;
	struct bo *book;
	int auth[26];
	memset(auth,0,sizeof(int)*26);
	scanf("%d",&n);
	book=(struct bo *)malloc(sizeof(struct bo)*n);
	for(i=0;i<n;i++){
		scanf("%s%s",book[i].id,book[i].au);
		for(j=0;book[i].au[j];j++){
			auth[book[i].au[j]-'A']++;
		}	
	}
	max=0;
	for(i=0;i<26;i++)
	{
		if(max<auth[i]) {
			max=auth[i];
			maxa=i+'A';
		}
	}
	printf("%c\n",maxa);
	printf("%d\n",max);
	for(i=0;i<n;i++){
		if(strchr(book[i].au,maxa))
			printf("%s\n",book[i].id);
	}

	return 0;
}
void main()
{
	struct
	{
		int NO;
		char AUT[27];
	}book[999];
	int i,j,k,m,n,d,max;
	int a[26]={0},b[26][999];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d ",&book[i].NO);
		gets(book[i].AUT);
		for(j=0;book[i].AUT[j]!='\0';j++)
		{
			d=book[i].AUT[j]-65;
			b[d][a[d]]=book[i].NO;
			a[d]=a[d]+1;
		}
	}
	max=0;
	for(i=0;i<26;i++)
	{
		if(a[i]>max)
		{
			max=a[i];
			k=i;
		}
	}
	printf("%c\n%d\n",k+65,max);
	for(i=0;i<a[k]-1;i++)
	{
		printf("%d\n",b[k][i]);
	}
	printf("%d",b[k][a[k]-1]);
}
//********************************
//*???? ??(13.8) ????
//********************************

int main()
{
	int n,i,nu,au,M,m;
	int num[26] = {0};
	int no[26][999];
	char aut;
	cin >> n;
	for(i = 0; i < n; i++)
	{
		cin >> nu;
		cin.get();
		aut = cin.get();
		while (aut != 10)
		{
			au = (int)(aut - 'A');
			no[au][num[au]] = nu;
			num[au]++;
			aut = cin.get();
		}
	}
	M = 0;
	for(i = 0; i < 26; i++)
	{
		if(M < num[i])
		{
			M = num[i];
			m = i;
		}
	}
	cout << (char)(m + 'A') << endl;
	cout << M << endl;
	for(i = 0; i < M; i++)
		cout << no[m][i] << endl;
	cin.get();
    cin.get(); //????
	return 0;
}
int main()
{
	struct Book{
		int id;
		char zz[26];
	}book[1000];
	
	int n,i,j,max=0,index;
	int sum[26]={0};
	char author;
	scanf("%d",&n);
	for (i=0;i<n;i++){
		scanf("%d%s",&book[i].id,&book[i].zz);
	}
	
	for (i=0;i<n;i++){
		for (j=0;book[i].zz[j]!='\0';j++){
			sum[book[i].zz[j]-'A']++;
		}
	}
	
	for (i=0;i<26;i++){
		if (sum[i]>max){
			max=sum[i];
			author='A'+i;
		}
	}
	printf("%c\n%d\n",author,max);
	
	for (i=0;i<n;i++){
		for (j=0;book[i].zz[j]!='\0';j++){
			if (book[i].zz[j]==author){
				printf("%d\n",book[i].id);
				break;
			}
		}
	}
    return 0;
}
int main()
{
	int n,a[1000],c[26]={0},max1=0,temp;
	char m[1000][26],max2;
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i-1];
		getchar();
		cin.getline(m[i-1],26);
	}
	for(int i=0;i<n;i++)
		for(int j=0;j<26;j++)
		{
			c[m[i][j]-'A']++;
		}
	//cout<<c[1]<<endl;
	for(int s=0;s<26;s++)
	{
		//cout<<c[s]<<" "<<max1<<endl;
		if(max1<=c[s])
		{
			max1=c[s];
			temp=s+'A';
			max2=temp;
		}
	}
	cout<<max2<<endl;
	cout<<max1<<endl;
	for(int i=0;i<n;i++)
		for(int j=0;j<26;j++)
			if(m[i][j]==max2)
			{
				cout<<a[i]<<endl;
				break;
			}

	return 0;
}
int main()
{
    int a[100][100],b[27],max= 0;
    int i , j , n , k , t ,len = 0;
    char str[100][27];
    scanf("%d",&n);
    memset( a, 0 ,sizeof(a) );
    memset( b ,0 ,sizeof(b) );
    for( i = 1;i <= n;i++ )
    {
      scanf( "%d",&a[i][1]);
      scanf("%s",str[i]);
      len = strlen (str[i]);
      for( j = 0;j < len;j++ )
      {
      k =  str[i][j]-'A'; 
       b[k]++;
       a[i][k+65] = 1;
      }
      }
      for( i = 0;i <= 25 ;i++ )
      {
      if( b[i] >max )
      {
         max= b[i];
         t = i; 
      }
      }
      printf("%c\n%d\n",t+'A',max);
      for( i = 1;i <= n;i++ )
      {
         if( a[i][t+'A']==1 )
         printf("%d\n",a[i][1]); 
      }
}
int main()
{
    char ma='A';
    int cnt[ASCII]={0};
    int i,j,n;
    
    struct {
         int id;
         char au[MAX_N+1];
    }bk[MAX_M];
    
    scanf("%d",&n);
    for(i=0;i<n;i++)
      {  scanf("%d%s",&bk[i].id,bk[i].au);
         for(j=0;bk[i].au[j];j++)
           { if(++cnt[bk[i].au[j]]>cnt[ma])
             {
                 ma=bk[i].au[j];
             }
           }
       }

      printf("%c\n%d\n",ma,cnt[ma]);
      for(i=0;i<n;i++)
       {   if(strchr(bk[i].au,ma))
          {
             printf("%d\n",bk[i].id);
          }
       }

   return 0;
}
struct book{
	int num;
	char writer[27];
};

void main()
{
	struct book *p,*head;
	int n,i,j,max,maxi;
	int l[26]={0},lnum[999];
	void count(int *l,struct book *p,int lnum);
	int read(struct book *p);

	scanf("%d",&n);
	head=p=(struct book *)calloc(n,sizeof(struct book));
	for(i=0;i<n;i++,p++)
	{
		lnum[i]=read(p);
	}
	p=head;
	for(i=0;i<n;i++)
	{
		count(l,p,lnum[i]);
		p++;
	}
	max=l[0];  maxi=0;
	for(i=1;i<26;i++)
	{
		if(max<l[i])
		{
			max=l[i];
			maxi=i;
		}
	}
	printf("%c\n",65+maxi);
	printf("%d\n",max);
	p=head;
	for(i=0;i<n;i++)
	{
		for(j=0;j<lnum[i];j++)
		{
			if(p->writer[j]==65+maxi)
			{
				printf("%d\n",p->num);
				break;
			}
		}
		p++;
	}
}
int read(struct book *p)
{
	int i=0;
	char d;
	scanf("%d",&p->num);
	d=getchar();
	d=getchar();
	do{
		p->writer[i]=d;
		i++;
	}while((d=getchar())!='\n');
	return(i);
}
void count(int *l,struct book *p,int lnum)
{
	int i;
	for(i=0;i<lnum;i++)
	{
		switch(p->writer[i])
		{
		case'A':l[0]++; break;     case'B':l[1]++; break;
		case'C':l[2]++; break;     case'D':l[3]++; break;
		case'E':l[4]++; break;     case'F':l[5]++; break;
		case'G':l[6]++; break;     case'H':l[7]++; break;
	    case'I':l[8]++; break;     case'J':l[9]++; break;
		case'K':l[10]++; break;     case'L':l[11]++; break;
		case'M':l[12]++; break;     case'N':l[13]++; break;
		case'O':l[14]++; break;     case'P':l[15]++; break;
		case'Q':l[16]++; break;     case'R':l[17]++; break;
		case'S':l[18]++; break;     case'T':l[19]++; break;
		case'U':l[20]++; break;     case'V':l[21]++; break;
		case'W':l[22]++; break;     case'X':l[23]++; break;
		case'Y':l[24]++; break;     case'Z':l[25]++; break;
		}
	}
}