semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	int *p;
	char q[1000][30];
	int shu[26]={0};
	char zm[]={'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'};
	int n,i,j,k;
	int len,max=0;
	scanf("%d",&n);
	p=(int*)malloc(sizeof(int)*n);
	for(i=0;i<n;i++)
	{
		len=0;
		scanf("%d %s", &p[i],q[i]);
		len=strlen(q[i]);
		for(j=0;j<len;j++)
		{
			for(k=0;k<26;k++)
			{
				if(q[i][j]==zm[k])
					shu[k]++;
			}
		}
	}
	for(i=0;i<26;i++)
	{
		if(shu[i]>max)
		{
			max=shu[i];
			k=i;
		}	
	}	
	printf("%c\n%d\n",zm[k],shu[k]);	
	for(i=0;i<n;i++)
	{
		len=strlen(q[i]);
		for(j=0;j<len;j++)
		{
			if(q[i][j]==zm[k])
				printf("%d\n",p[i]);
		}
	}
	free(p);
	return 0;
}
int main()
{
	int m;
	cin>>m;
	int num[1001];
	
	char name[1001][27];
	for(int i=0;i<m;++i)
	{
	   cin>>num[i];
	   cin.get();
	   cin.getline(name[i],27);
    }
	int count[100];memset(count, 0, sizeof(count));
	int record[27][1000];
	int start=0;
	int i,j;
	 char call;
	for( i=0;i<m;i++)
	{
	   for( j=0;j<strlen(name[i]);j++)
	   {
	      count[name[i][j]]++;
		   //call=name[i][j]-'A';
		  //record[call][start++]=num[i];
	   }
	}
	int max=0,k=0;
	char t;
	for(char w = 'A';w<='Z';w++)
	{
	   if(count[(int)w]>max)
		  { max=count[(int)w];
	   t=w;
	   }
    }
	cout<<t<<endl;
   cout<<max<<endl;
  for( i=0;i<m;i++)
	{
	   for( j=0;j<strlen(name[i]);j++)
	   {
	   if(name[i][j]==t)
	   {cout<<num[i]<<endl;  continue;  }
	   }
  }

   return 0;
}
struct book{
	int num;
	char author[26];
};
char max(int *p);

int main()
{
	int m,b,i,*p;
	struct book shu[999];
	char c;
	int writer[26];
	scanf("%d",&m);
	for(i=0;i<m;i++){
		scanf("%d%s",&shu[i].num,shu[i].author);
	}
	for(c='A',writer[c-'A']=0;c<='Z';c++){
		writer[c-'A']=0;
		for(i=0;i<m;i++){
			for(b=0;shu[i].author[b]!='\0';b++){
				if(c==shu[i].author[b]){
					writer[c-'A']++;
				}
			}
		}
	}
	p=writer;
	printf("%c\n%d\n",max(p),writer[max(p)-'A']);
	for(i=0;i<m;i++){
		for(b=0;shu[i].author[b]!='\0';b++){
			if(max(p)==shu[i].author[b]){
				printf("%d\n",shu[i].num);
			}
		}
	}
	return 0;
}
	char max(int *p)
	{
		int i;
		char max;
		for(i=0,max='A';i<26;i++){
			if(*(p+i)>*(p+max-'A')){
				max=i+'A';
			}
		}
		return max;
	}
int main(int argc, char* argv[])
{
	int n,i,j,m,b=0,max;
	int let[26]={0};
	char a;
	struct student{
		int num;
		char name[26];
	}book[999];
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d%s",&book[i].num,&book[i].name);
	}
	for(i=0;i<n;i++){
		m=strlen(book[i].name);
		for(j=0;j<m;j++){
			let[book[i].name[j]-'A']++;
		}
	}
	max=let[0];
	for(i=0;i<25;i++){
		if(let[i]>max){
			max=let[i];
			b=i;
		}
	}
	a=b+'A';
	printf("%c\n%d\n",a,max);
	for(i=0;i<n;i++){
		m=strlen(book[i].name);
		for(j=0;j<m;j++){
			if(book[i].name[j]==a){
				printf("%d\n",book[i].num);
			}
		}
	}
	return 0;
}
void main()
{
	struct book
	{
		char num[20];
		char ren[30];
		struct book *next;
	};

	int n;
	int a[26]={0};
	struct book *head,*p1,*p2;
	int i,j;
	char tem;
	char b[100][30];

	p1=(struct book *)malloc(L);
	head=p1;

	scanf("%d",&n);

	for(i=0;i<n;i++)
	{
		scanf("%s%s",p1->num,p1->ren);
		p2=p1;
		p1=(struct book *)malloc(L);
		p2->next=p1;
	}
	p1=head;
	for(i=0;i<n;i++)
	{
		for(j=0;j<strlen(p1->ren);j++)
		{
			int t=p1->ren[j]-'A';
			a[t]++;
		}
		p1=p1->next;
	}

	int max=0;
	for(i=0;i<26;i++)
	{
		if(a[i]>max)
		{
			max=a[i];
			tem='A'+i;
		}
	}
	printf("%c\n",tem);
	p1=head;
	int u=0;
	for(i=0;i<n;i++)
	{
		for(j=0;j<strlen(p1->ren);j++)
		{
			if(p1->ren[j]==tem)
			{
				strcpy(b[u],p1->num);
				u++;
			}
		}
		p1=p1->next;
	}
	printf("%d\n",u);

	for(i=0;i<u;i++)
	{
		printf("%s\n",b[i]);
	}
}
int main()
{
    int n;
    scanf("%d",&n);
	struct book{
		int booknumber;
		char writer[27];
	}book[999];
	int i;
	for(i=0;i<n;i++)
	{
		scanf("%d %s",&book[i].booknumber,book[i].writer);
	}
	int writerbookquantity[26];
	for(i=0;i<26;i++)writerbookquantity[i]=0;
	int j,len,x;
	for(i=0;i<n;i++)
	{
		len=strlen(book[i].writer);
		for(j=0;j<len;j++)
		{
            x= book[i].writer[j]-'A';
			writerbookquantity[x]++;
		}
	}
	int maxwriter=0,maxquantity=0;
    for(i=0;i<26;i++)
	{
       if(writerbookquantity[i]>maxquantity)
	   {
		   maxquantity=writerbookquantity[i];
		   maxwriter=i;
	   }
	}
	printf("%c\n%d\n",(char)(maxwriter+'A'),writerbookquantity[maxwriter]);
    for(i=0;i<n;i++)
	{
		len=strlen(book[i].writer);
		for(j=0;j<len;j++)
		{
            if((int)book[i].writer[j]==maxwriter+'A')
				printf("%d\n",book[i].booknumber);

		}
	}
	return 0;

}
int n;
struct stu
{int num;
char name[27];
struct stu *next;
};

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

void main()
{struct stu *p,*head;
int k,u,max=0,maxnum;
int a[26]={0};
	scanf("%d",&n);
head=p=creat();
for (k=0;k<n;k++)
			{for (u=0;p->name[u]!='\0';u++)
				a[p->name[u]-'A']++;
			p=p->next;
			} 
for(k=0;k<26;k++)
if(a[k]>max){max=a[k];maxnum=k;}
printf("%c\n%d\n",maxnum+'A',max);
p=head;
for(k=0;k<n;k++){
for(u=0;p->name[u]!='\0';u++)
if(p->name[u]==maxnum+'A'){printf("%d\n",p->num);break;}
p=p->next;
}}
int main()
{
	int A[100],C[26]={0},n,i,j,m,a=0,b;
	char B[100][100],c;
	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<strlen(B[i]);j++)
		{
			m=B[i][j];
			C[m-65]++;
		}
	}
	for (i=0;i<26;i++)
	{
		if (a<C[i])
		{
			a=C[i];
			b=i;
		}
	}
	printf("%c\n",b+65);
	printf("%d\n",a);
	c=b+65;
	for (i=0;i<n;i++)
	{
		for (j=0;j<strlen(B[i]);j++)
		{
			if (B[i][j]==c)
			{
				printf("%d\n",A[i]);
			}
		}
	}


	return 0;
}
void main()
{
	struct x
	{
		char num[26];
		int y;
	}q[1000],x0;
	
	int n,i,j,c[100]={0},m=0,f;

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

	for(i=0;i<n;i++)
		for(j=0;q[i].num[j]!='\0';j++)
                  m=(int)q[i].num[j],c[m]=c[m]+1;
	
for(m=0;m<100;m++)
if(c[m]>c[0])
f=m,c[0]=c[m];

printf("%c\n%d\n",(char)f,c[f]);
for(i=0;i<n;i++)
for(j=0;q[i].num[j]!='\0';j++)
if(q[i].num[j]==(char)f)
printf("%d\n",q[i].y);

}
int m;
struct book
{
	char num[20];
	char aut[20];
	struct book*next;
};
struct book*creat()
{
	struct book*head,*p1,*p2;
	int i;
	p1=(struct book*)malloc(LEN);
	scanf("%s %s",p1->num,p1->aut);
	p1->next=NULL;
	head=p1;
	p2=p1;
	for(i=1;i<m;i++)
	{
		p1=(struct book*)malloc(LEN);
	    scanf("%s %s",p1->num,p1->aut);
	    p1->next=NULL;
		p2->next=p1;
		p2=p1;
	}
	return(head);
}
void print(struct book*head)
{
	struct book*p;
	int*tem,i,k;
	char*q,max,c;
	tem=(int*)malloc(30*sizeof(int));
	for(i=0;i<30;i++)
	{
		*(tem+i)=0;
	}
	for(p=head;p;p=p->next)
	{
		q=p->aut;
		for(i=0;*(q+i)!='\0';i++)
		{
			c=*(q+i)-'A';
			*(tem+c)+=1;
		}
	}
	max=0;
	k=0;
	for(i=0;i<26;i++)
	{
		if(*(tem+i)>max)
		{
			max=*(tem+i);
			k=i;
		}
	}
	c=k+'A';
	printf("%c\n",c);
	printf("%d\n",max);
	for(p=head;p;p=p->next)
	{
		for(q=p->aut,i=0;*(q+i)!='\0';i++)
		{
			if(*(q+i)==c)
			{
				break;
			}
		}
		if(*(q+i)!='\0')
		{
			printf("%s\n",p->num);
		}
	}
}
int main()
{
	struct book*head;
	scanf("%d",&m);
	head=creat();
	print(head);
}
struct book
{
	int number;
	char author[26];
    struct book *next;
};
int m,i;
struct book *creat(void)
{
	struct book *head,*p1,*p2;
	int i=1;
	p1=p2=(struct book *)malloc(sizeof(struct book));
	head=p1;
	for(i=1;i<m;i++)
	{
		scanf("%d %s",&p1->number,p1->author);
		p1=(struct book *)malloc(sizeof(struct book));
		p2->next=p1;
		p2=p1;
	}
	scanf("%d %s",&p1->number,p1->author);
	p2->next=p1;
	p1->next=NULL;
	return head;
}
main()
{
	struct book *head,*p;
	int j,a[26]={0},max;
    scanf("%d",&m);
	head=creat();
	for(p=head;p!=NULL;p=p->next)
	for(i=0;i<strlen(p->author);i++)
		switch(p->author[i])
	{
	case 'A': a[0]++;break;
	case 'B': a[1]++;break;
	case 'C': a[2]++;break;
	case 'D': a[3]++;break;
	case 'E': a[4]++;break;
	case 'F': a[5]++;break;
	case 'G': a[6]++;break;
	case 'H': a[7]++;break;
	case 'I': a[8]++;break;
	case 'J': a[9]++;break;
	case 'K': a[10]++;break;
	case 'L': a[11]++;break;
	case 'M': a[12]++;break;
	case 'N': a[13]++;break;
	case 'O': a[14]++;break;
	case 'P': a[15]++;break;
	case 'Q': a[16]++;break;
	case 'R': a[17]++;break;
	case 'S': a[18]++;break;
	case 'T': a[19]++;break;
	case 'U': a[20]++;break;
	case 'V': a[21]++;break;
	case 'W': a[22]++;break;
	case 'X': a[23]++;break;
	case 'Y': a[24]++;break;
	case 'Z': a[25]++;break;
	}
	max=a[0];
	for(i=0;i<26;i++)
		if(a[i]>max)max=a[i];
    for(i=0;i<26;i++)
		if(a[i]==max)
		{printf("%c\n",65+i);break;}
		printf("%d\n",max);
	for(p=head;p!=NULL;p=p->next)
	for(j=0;j<strlen(p->author);j++)
		if(p->author[j]==65+i)printf("%d\n",p->number);
}
struct student
{
	int num;
	char str[27];
	struct student *next;
};
int n;
struct student *creat(int m)
{
	struct student *head;
	struct student *p1,*p2;
	
	p1=p2=(struct student*)malloc(LEN);
	scanf("%ld %s",&p1->num,p1->str);
	n=1;
	head=0;
	while(n<m)
	{
		if(n==1)head=p1;
		else p2->next=p1;
		p2=p1;
		p1=(struct student *)malloc(LEN);
		scanf("%d %s",&p1->num,p1->str);
		n=n+1;
	}
	p2->next=p1;
	p1->next=0;
	return(head);
}
void main()
{
	struct student *head,*p,stu;
	int m,i,t,max,y=1,a[100]={0},sum[27]={0};
	char x,c;
	scanf("%d",&m);
	head=creat(m);
	p=head;
	for(;p!=0;p=p->next)
	{
		for(t=0;t<strlen(p->str);t++)
		{
			c=p->str[t];
			sum[c-'A'+1]++;
		}
	}
	max=sum[1];
	x=1;
	for(i=1;i<=26;i++)
		if(sum[i]>max){max=sum[i];x=i;}
		for(p=head;p!=0;p=p->next)
		{
			for(t=0;t<=strlen(p->str);t++)
				if(p->str[t]==x+'A'-1) {a[y]=p->num;y++;t=strlen(p->str)+1;}
				
		}
		printf("%c\n%d\n",x+64,max);
		for(y=1;y<=max;y++)
			printf("%d\n",a[y]);

			
}
void main()
{
	int b[1000],d[1000],e[30]={0};
	int i,j,k,n,t=0,max;
	char c[1000][10];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d %s",&b[i],c[i]);
		d[i]=(int)strlen(c[i]);
	}
    for(i=0;i<n;i++)
	   for(j=0;j<d[i];j++)
		   for(k=0;k<26;k++)
		       if(c[i][j]==k+65)e[k]=e[k]+1;
	max=e[0];
	for(k=1;k<26;k++)
	{
		if(e[k]>max)
		{
			t=k;
			max=e[k];
		}
	}

	printf("%c\n",t+65);
	printf("%d\n",e[t]);
	for(i=0;i<n;i++)
		for(j=0;j<d[i];j++)
			if(c[i][j]==t+65)printf("%d\n",b[i]);
}
struct book
{
	int num;
	char writer[26];
}book[1000];
void main()
{
	int n,i,j,e,max=0;
	scanf("%d",&n);
	char da,c;
	int temp[27]={0};
	for(i=0;i<n;i++)
	{
		scanf("%d%s",&book[i].num,book[i].writer);
	}	
	for(i=0;i<n;i++)
	{
		for(da='A';da<='Z';da++)
		{
			for(j=0;j<26;j++)
			{
				if(book[i].writer[j]==da)
					temp[da-'A'+0]++;
			}
		}
	}
	for(j=0;j<26;j++)
	{
		if(temp[j]>max)
		{
			max=temp[j];
		}
	}
	for(j=0;j<26;j++)
	{
		if(temp[j]==max)
		{
			c=j+65;
        printf("%c\n%d\n",c,temp[j]);
		}
	}
	for(i=0;i<n;i++){
		for(j=0;j<26;j++){
			if(book[i].writer[j]==c)
				printf("%d\n",book[i].num);
		}
	}
}
struct shu
{
	int haoma;
	char b[26];
	struct shu *next;
};

int main()
{
	int n,i,a[26],c[26][100],max;
	int *s,(*q)[100];
	s=a;
	q=c;
	char m[26];
	struct shu *head,*p;
	for(i=0;i<26;i++)
		a[i]=0;
	scanf("%d",&n);
     head=(struct shu *)malloc(n*sizeof(shu));
	 p=head;
	 for(i=0;i<n-1;i++)
	 {
		 (p+i)->next=p+i+1;
	 }
	 (p+n-1)->next=0;
	 p=head;
	 for(;p!=0;)
	 {
		 scanf("%d %s",&p->haoma,p->b);
		strcpy(m,p->b);
		 for(i=0;*(m+i)!='\0';i++)
		 {
			 *(*(q+*(m+i)-65)+*(s+*(m+i)-65))=p->haoma;
			 //c[m[i]-65][a[m[i]-65]]=p->haoma;
			 *(s+*(m+i)-65)+=1;
			 //a[m[i]-65]++;			
		 }
		 p=p->next;
	 }
	 max=0;
	 for(i=0;i<26;i++)
		 if(*(a+i)>max)
		 {
			 max=*(a+i);
			 n=i;
		 }
	 printf("%c\n",n+65);
	 printf("%d\n",*(a+n));
	 for(i=0;i<*(a+n);i++)
	 {
		 printf("%d\n",*(*(q+n)+i));
	 }
	 
}
int main()
{
	int m, b, book[1000][27] = {0}, writer[26] = {0}, max = 0;
	char w;
	cin >> m;
	for(int i = 1; i <= m; i++)
	{
		cin >> b;
		book[i][26] = b;
		cin.get();
		while((w = cin.get()) != '\n')
		{
			writer[w - 'A']++;
			book[i][w - 'A'] = 1;
		}
	}
	for(int i = 1; i < 26; i++)
		if(writer[max] < writer[i])
			max = i;
	cout << (char) (max + 'A') << endl;
	cout << writer[max] << endl;
	for(int i = 1; i <= m; i++)
		if(book[i][max])
			cout << book[i][26] << endl;
	return 0;
}
struct xinxi
{
	int sh;
	char zz[20];
}a[1000];
void main()
{
	int n,i,l,j,b[26]={0},m=0,k=0;
	char c;
	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d%s",&a[i].sh,a[i].zz);
	for(i=0;i<n;i++)
	{
		l=strlen(a[i].zz);
		for(j=0;j<l;j++)
			b[a[i].zz[j]-65]++;
	}
	for(i=0;i<26;i++)
		if(b[i]>m) {m=b[i];k=i;}
		c=k+65;
		printf("%c\n%d\n",c,m);
		for(i=0;i<n;i++)
	{
		l=strlen(a[i].zz);
		for(j=0;j<l;j++)
			if(a[i].zz[j]==c) printf("%d\n",a[i].sh);
	}
}
int main()
{
	struct writer
	{
		int num;
		char name[20];
		struct writer * next;
	};
	int i,j,k,l,m,z[26]={0},max,n;
	struct writer *p1,*p2,*p,*head;
	scanf("%d",&n);
	head=p1=p2=(struct writer *)malloc(sizeof(struct writer));
	scanf("%d %s",&p1->num,&p1->name);
	for (i=0;i<n-1;i++)
	{
		p1=(struct writer *)malloc(sizeof(struct writer));
		scanf("%d %s",&p1->num,&p1->name);
		p2->next=p1;
		p2=p1;
	}
    p=head;
	for (i=0;i<26;i++)    /*26?????????????????*/
	{ 
		p=head;
		for (j=0;j<n;j++)
		{
		    for (k=0;k<20;k++)
			{
			    if (p->name[k]==(char)(i+65))
				{
				    z[i]++;
				}
			}
			p=p->next;
		}
	}
    max=z[0];
	j=0;
	for (i=0;i<26;i++)
	{
		if (max<z[i])
		{
			max=z[i];
				j=i;     /*????????*/
		}
	}
	printf("%c\n%d\n",65+j,max);   /*??????????*/
	p=head;
	for (i=0;i<n;i++)   /*???????*/
	{
		for (k=0;k<20;k++)
		{
			if (p->name[k]==(char)(65+j))
			{
				printf("%d\n",p->num);
				break;
			}
		}
		p=p->next;
	}
}
struct book
{int num;
char str[200];
}bk[1000];
int main()
{
    int m,i,l,k,p=0,max,maxl;
    int a[200][1000];
    int b[200];
    scanf("%d",&m);
    for(i=0;i<m;i++)
    scanf("%d%s",&bk[i].num,bk[i].str);
    
    for(l=0;l<26;l++)
   {
   for(i=0;i<m;i++)
   { 
   for(k=0;bk[i].str[k]!='\0';k++)
   {
   if((bk[i].str[k])==l+65)
   {a[l][p]=bk[i].num;
   p++;}
}
}
b[l]=p;
p=0;
}
max=b[0];maxl=0;
for(l=0;l<26;l++)
{
if(b[l]>max)
{max=b[l];
maxl=l;}
}
printf("%c\n",maxl+65);
printf("%d\n",max);
for(i=0;i<max;i++)
printf("%d\n",a[maxl][i]);
    return 0;
}
void main()
{
	struct book
	{
		int num;
		char wri[26];
		struct book *next;
	};
	int n,m,i;
	scanf("%d",&m);
	struct book *head,*p1,*p2;
	n=0;
	p1=p2=(struct book *)malloc(L);
	scanf("%d%s",&p1->num,p1->wri);
	head=NULL;
	for(i=0;i<m-1;i++)
	{
		n=n+1;
		if(n==1)head=p1;
		else p2->next=p1;
		p2=p1;
		p1=(struct book *)malloc(L);
		scanf("%d%s",&p1->num,p1->wri);
	}
	p2->next=p1;
	p2=p1;
	p2->next=NULL;
	int a[26]={0},b,j,k,max1=0,max2;
	struct book *g;
	g=head;
	do
	{
		for(i=0;i<26;i++)
		{
			if(g->wri[i]!='\0')
			{
				b=g->wri[i];
				a[b-65]=a[b-65]+1;
			}
		}
		g=g->next;
	}while(g!=NULL);
	for(i=0;i<26;i++)
	{
		if(max1<a[i])
		{
			max1=a[i];
			max2=i;
		}
	}
	max2=max2+65;
	printf("%c\n%d",max2,max1);
	g=head;
	do
	{
		for(i=0;i<26;i++)
		{
			if(g->wri[i]==max2)
			{
				printf("\n%d",g->num);
				break;
			}
		}
		
		g=g->next;
	}while(g!=NULL);
}
struct book
{
	int num;
	char edt[27];
};
struct total   //??????????????
{
	char name;
	int amount;
};
int main()
{
	int m,i,j,k;
	struct book bk[1000];
	struct total to[27];
	scanf("%d",&m);
	for(i=0;i<m;i++)
		scanf("%d %s",&bk[i].num,bk[i].edt);
	for(i=0;i<26;i++)
	{
		to[i].name='A'+i;//????26???
		to[i].amount=0;
	}
	//???????????
	for(i=0;i<m;i++)
	{
		for(j=0;j<strlen(bk[i].edt);j++)
		{
			for(k=0;k<26;k++)
			{
				if(bk[i].edt[j]==to[k].name)
					to[k].amount ++;
			}
		}
	}
	//???????????????to[k]??
	for(i=k=0;i<26;i++)
	{
		if(to[i].amount>to[k].amount )
			k=i;
	}
	printf("%c\n%d\n",to[k].name ,to[k].amount );
	//??????????
	for(i=0;i<m;i++)
	{
		for(j=0;j<strlen(bk[i].edt);j++)
			if(bk[i].edt[j]==to[k].name)
				printf("%d\n",bk[i].num);
	}
	return 0;
}
int main()
{
	int n,i,j,k,w=0;
	int maxzm,maxbk=0;
	char c1;
	int zimu[26]={0};
	int lm[100];
	struct{
		int num;
		char a[100];
	}book[1000];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	   scanf("%d %s",&book[i].num,book[i].a);
	for(i=0;i<n;i++)
	{
		for(j=0;book[i].a[j];j++)
		{
			for(k=65;k<91;k++)
			{
				if(book[i].a[j]==k)
					zimu[k-65]++;
			}
		}
	}
	for(i=0;i<26;i++)
	{
         if(zimu[i]>maxbk)
		 {
			 maxbk=zimu[i];
			 maxzm=i;
		 }
	}
	c1=maxzm+65;
	printf("%c\n",c1);
	printf("%d\n",maxbk);
	for(i=0;i<n;i++)
	{
		for(j=0;book[i].a[j];j++)
		{
			if(book[i].a[j]==c1)
			{
				lm[w]=book[i].num;
				w++;
				continue;
			}

		}
	}
	for(i=0;i<w;i++)
		printf("%d\n",lm[i]);

		
		

	return 0;
}
struct book
{
	int ID;
	char author[30];
	struct book *next;
};
int n,max=0;
char c;
int num[26]={0};
struct book *create()
{
	struct book *head,*p1,*p2;
	p1=(struct book*)malloc(LEN);	
	scanf("%d %s",&p1->ID,p1->author);
	head=p1;
	p2=p1;
	p1->next=NULL;
	
	int i=1;
	do
	{
		if(i==n)break;
        p1=(struct book*)malloc(LEN);
		scanf("%d %s",&p1->ID,p1->author);
		p2->next=p1;
		p2=p1;
		p1->next=NULL;
		i++;
	}while(1);
	return(head);
}
void seek(struct book *head)
{
	struct book *p;
	char *s;
	p=head;
	while(p)
	{
		for(s=p->author;*s!='\0';s++)
		{
			int temp;
			temp=*s-'A';
			(*(num+temp))++;
		}
		p=p->next;
	}
}
void find(struct book *head)
{
	struct book *p;
	char *s;
	p=head;
	while(p)
	{
		for(s=p->author;*s!='\0';s++)
		{
			if(*s==c)break;
		}
		if(*s!='\0')printf("%d\n",p->ID);
		p=p->next;
	}
}





int main()
{
	struct book *head;
	int i;
	scanf("%d",&n);
	head=create();
	seek(head);
	for(i=0;i<26;i++)
	{
		if(*(num+i)>max)max=*(num+i);
	}
	for(i=0;i<26;i++)
	{
		if(*(num+i)==max)break;
	}
	printf("%c\n%d\n",'A'+i,max);
	c='A'+i;
	find(head);
}
int ismax(int l[],int a)
{
	int i;
	for(i=0;i<26;i++)
	{
		if(l[i]>l[a]) return(0);
	}
	return(1);
}

void main()
{
	int i,j,k,n,p,l[26]={0};
	struct shu
	{
		int num;
		char auth[100];
	} book[999];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d %s",&book[i].num,book[i].auth);
	}
	for(i=0;i<26;i++)
	{
		for(j=0;j<n;j++)
		{
			for(k=0;k<100;k++)
			{
				if(book[j].auth[k]==i+65)
					l[i]++;
			}
		}
	}
	for(i=0;i<26;i++)
	{
		if(ismax(l,i)==1)
		{
			printf("%c\n%d\n",i+65,l[i]);
			p=i;
		}
	}
	for(i=0;i<n;i++)
	{
		for(j=0;j<100;j++)
		{
			if(book[i].auth[j]==p+65)
				printf("%d\n",book[i].num);
		}
	}
}
struct book
{
	int num;
	char author[27];
	struct book *next;
};
void main()
{
	int m,i,j,k,a[26],sum=0;
	for(j=0;j<26;j++)
		a[j]=0;
	char aut;
	scanf("%d",&m);
	struct book *head,*pb1,*pb2;
	head=NULL;
	for(i=0;i<m;i++)
	{
		pb1=(struct book*)malloc(sizeof(struct book));
		scanf("%d %s",&pb1->num,pb1->author);
		for(j=0;pb1->author[j]!='\0';j++)
		{
			k=pb1->author[j]-'A';
			a[k]+=1;
		}
		if(head==NULL) {head=pb1;pb2=pb1;pb2->next=NULL;}
		else 
		{
			pb2->next=pb1;pb2=pb1;pb2->next=NULL;
		}
	}
	for(j=0;j<26;j++)
	{if(a[j]>sum) {sum=a[j],k=j;}
	}
	aut=(char)('A'+k);
    printf("%c\n",aut);
    printf("%d\n",sum);
	pb1=head;
	while(pb1)
	{
		for(j=0;pb1->author[j]!='\0';j++)
			if(pb1->author[j]==aut) printf("%d\n",pb1->num);
        pb1=pb1->next;
	}
}
int main()
{
    int i,j,n,k,c,big=0;
    int num[30]={0},a[1000];
    char name[1000][20];
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        scanf("%d %s",&a[i],name[i]);
    }
    for(k=0;k<26;k++)
    {
      for(i=0;i<n;i++)
      {
        for(j=0;j<strlen(name[i]);j++)
        {
            if(name[i][j]==k+'A')
               num[k]=num[k]+1;
        }
      }
    }
    for(i=0;i<26;i++)
    {
        if(big<num[i])
        {big=num[i];
        c=i+'A';
        }
    }
    printf("%c\n",c);
    printf("%d\n",big);
   /* for(i=0;i<n;i++)
    {
        if(num[i]==big)
          printf("%d\n",big);
    }*/
    for(i=0;i<n;i++)
    {
        for(j=0;j<strlen(name[i]);j++)
        {
            if(name[i][j]==c)
            printf("%d\n",a[i]);
        }
    }
    return 0;
}
struct book
{
	int num;
	char writer[27];
	struct book *next;
};
int n;
int time[26]={0},max,k;
struct book *create(int m)
{
	struct book *head;
	struct book *p1,*p2;
	n=0;
	p1=p2=(struct book *)malloc(LEN);

	head=NULL;
	while(n<m)
	{
		scanf("%d %s",&p1->num,p1->writer);
		n=n+1;
		if(n==1) head=p1;
		else p2->next=p1;
		p2=p1;
		p1=(struct book *)malloc(LEN);
	    
	}
	p2->next=NULL;
	return (head);
}

void search(struct book *head)
{
	int i;
	struct book *p;
	p=head;
	if(head!=NULL)
	{
		do
		{
			for(i=0;(p->writer)[i]!='\0';i++)
				time[(p->writer)[i]-'A']++;
			p=p->next;
		}
		while(p!=NULL);
	}
}

void pr(struct book *head)
{
	int i;
	struct book *p;
	p=head;
	if(head!=NULL)
	{
		do
		{
			for(i=0;(p->writer)[i]!='\0';i++)
			{
				if((p->writer)[i]=='A'+k)
					printf("%d\n",p->num);
			}
			head = p;
			p=p->next;
			free(head);
		}
		while(p!=NULL);
	}
}


void main()
{
	int m,i;
	scanf("%d",&m);
	struct book *head;
	head=create(m);
	search(head);
	max=time[0];
	k=0;
	for(i=1;i<26;i++)
	{
		if(time[i]>max)
		{
			max=time[i];
			k=i;
		}
	}
	printf("%c\n%d\n",'A'+k,max);
	pr(head);
}
struct book
{
	int H;
	char writer[26];
}b[max];
int main()
{
	int m,i,j,k,sum[26]={0},t,Max,g;
	char y;
	scanf("%d",&m);
	for(i=0;i<m;i++)
	{
		scanf("%d %s",&b[i].H,b[i].writer);
		t=strlen(b[i].writer);
		for(j=0;j<t;j++)
		{
			k=b[i].writer[j]-65;
			sum[k]++;
		}
	}
	Max=sum[0];
	for(i=0;i<26;i++)
	{
		if(sum[i]>Max)
			Max=sum[i];
	}
	for(i=0;i<26;i++)
	{
		if(sum[i]==Max)
		{
			y=i+65;
			printf("%c\n%d\n",y,Max);
		}
	}
	for(i=0;i<m;i++)
	{
		g=0;
		t=strlen(b[i].writer);
		for(j=0;j<t;j++)
		{
		if(b[i].writer[j]==y)
		{
			g++;
			break;
		}
		}
		if(g!=0)
			printf("%d\n",b[i].H);
	}
	return 0;
}
struct book
{
	int num;
	char aut[27];
	struct book *next;
};
int n;
struct book *creat(int amount)
{
	struct book *head;
	struct book *p1,*p2;
	n=0;
	p1=(struct book *)malloc(sizeof(struct book));
	p2=p1;
	scanf("%d %s",&p1->num,p1->aut);
	while(n<amount-1)
	{
		n=n+1;
		if(n==1)head=p1;
		else p2->next=p1;
		p2=p1;
		p1=(struct book *)malloc(sizeof(struct book));
		scanf("%d %s",&p1->num,p1->aut);
	}
	p2->next=p1,p1->next=NULL;
	return(head);
}
int main()
{
	int amount,i,a[26]={0},max,maxn;
	struct book *p,*headp;
	char *auth,name[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'};
	scanf("%d",&amount);
	p=creat(amount);
	headp=p;
	for(p=headp;p!=NULL;p=p->next)
	{
		for(auth=p->aut;*auth!='\0';auth++)
		{
			for(i=0;i<26;i++)
			{
				if(name[i]==*auth)break;
			}
			a[i]=a[i]+1;
		}
	}
	for(i=0,max=a[0],maxn=0;i<26;i++)
	{
		if(a[i]>max)max=a[i],maxn=i;
	}
	printf("%c\n%d\n",name[maxn],max);
	for(p=headp;p!=NULL;p=p->next)
	{
		for(auth=p->aut;*auth!='\0';auth++)
		{
			if(*auth==name[maxn])break;
		}
		if(*auth=='\0');
		else printf("%d\n",p->num);
	}
}
struct book
{int num;
char a[27];
int y;
struct book *next;
};

void main()
{int n,i,j,k,m=0,num,max;
struct book *p1,*p2,*p,*head;
int c[26]={0};
scanf("%d",&n);
head=p1=p2=Z;
for(i=0;i<n;i++)
{p2->next=p1;
p2=p1;
scanf("%d%s",&p2->num,p2->a);
num=strlen(p2->a);
for(j=0;j<num;j++)
c[*(p2->a+j)-65]++;
p1=Z;
}
p2->next=0;

max=0;
for(i=0;i<26;i++)
if(c[i]>c[max])
max=i;
max=max+65;
p=head;
for(i=0;i<n;i++)
{num=strlen(p->a);
for(j=0;j<num;j++)
if(*(p->a+j)==max)
break;
if(j==num)
p->y=0;
else {p->y=1;m++;}
p=p->next;
}
p=head;
printf("%c\n%d\n",max,m);
for(i=0;i<n;i++)
{if(p->y==1)
printf("%d\n",p->num);
p=p->next;
}
}
int main()
{
	int m;
	char a[1000][10]={0};    //????
	char b[1000][30];    //????
	int len[1000]={0};      //?????????
	int c[150]={0};  //???????
	int max=0; //??????????????
	int i,j,k,p,q,r,s;  //????
	scanf("%d", &m);
	for(i=0;i<m;i++)
	{
		scanf("%s %s", a[i], b[i]);
		len[i]=strlen(b[i]);
		//printf("%d\n", len[i]);
		for(j=0;j<len[i];j++)
		{
			//printf("%d\n", b[i][j]);
			for(k=65;k<=90;k++)
			{
				if(b[i][j]==k)
					c[k]++;
			}
		}
	}
	for(p=65;p<=90;p++)
	{
		if(c[p]>max)
			max=c[p];
	}
	for(q=65;q<=90;q++)
	{
		if(c[q]==max)
		{
			printf("%c\n%d\n", q, max);
			for(r=0;r<m;r++)
			{
				for(s=0;s<len[r];s++)
				{
					if(b[r][s]==q)
						printf("%s\n", a[r]);
				}
			}
		}
	}

	return 0;
}
int main()
{
	int m,sum[27]={0},max=0,author;
	cin>>m;
	char str[1000][4],name[1000][27];
	for(int i=0;i<m;i++)	cin>>str[i]>>name[i];
	for(int i=0;i<m;i++){
		for(int j=0;j<strlen(name[i]);j++)
			sum[name[i][j]-'A']++;
	}
	for(int i=0;i<26;i++){
		if(max<sum[i]){
			max=sum[i];
			author=i;
		}
	}
	cout<<(char)('A'+author)<<endl;
	cout<<max<<endl;
	for(int i=0;i<m;i++){
		for(int j=0;j<strlen(name[i]);j++){
			if(name[i][j]-'A'==author) cout<<str[i]<<endl;
		}
	}
	return 0;
}