semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
char name[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'};
int main()
{
	int n,t,i,j;
	int count[26],max=0;
	for(i=0;i<26;i++) count[i]=0;
	struct book
	{
		int num;
		char man[26];
	} book[999];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d%s",&book[i].num,book[i].man);
		for(j=0;book[i].man[j];j++)
		{
			if(book[i].man[j]=='A') count[0]++;
			else if(book[i].man[j]=='B') count[1]++;
			else if(book[i].man[j]=='C') count[2]++;
			else if(book[i].man[j]=='D') count[3]++;
			else if(book[i].man[j]=='E') count[4]++;
			else if(book[i].man[j]=='F') count[5]++;
			else if(book[i].man[j]=='G') count[6]++;
			else if(book[i].man[j]=='H') count[7]++;
			else if(book[i].man[j]=='I') count[8]++;
			else if(book[i].man[j]=='J') count[9]++;
			else if(book[i].man[j]=='K') count[10]++;
			else if(book[i].man[j]=='L') count[11]++;
			else if(book[i].man[j]=='M') count[12]++;
			else if(book[i].man[j]=='N') count[13]++;
			else if(book[i].man[j]=='O') count[14]++;
			else if(book[i].man[j]=='P') count[15]++;
			else if(book[i].man[j]=='Q') count[16]++;
			else if(book[i].man[j]=='R') count[17]++;
			else if(book[i].man[j]=='S') count[18]++;
			else if(book[i].man[j]=='T') count[19]++;
			else if(book[i].man[j]=='U') count[20]++;
			else if(book[i].man[j]=='V') count[21]++;
			else if(book[i].man[j]=='W') count[22]++;
			else if(book[i].man[j]=='X') count[23]++;
			else if(book[i].man[j]=='Y') count[24]++;
			else if(book[i].man[j]=='Z') count[25]++;
		}
	}
	for(i=0;i<26;i++)
	{
		if(count[i]>max)
		{
			max=count[i];
			t=i;
		}
	}
	printf("%c\n%d\n",name[t],max);
	for(i=0;i<n;i++)
	{
		for(j=0;book[i].man[j];j++)
		{
			if(book[i].man[j]==name[t]) printf("%d\n",book[i].num);
		}
	}
	return 0;
}
struct jisuan{
         int num;
	char name[26];
}book[1000];
int main()
{
	int i,j,m,n,k,e;
	int count[26]={0},author[26];
	scanf("%d",&m);
	for(i=0;i<26;i++)
	         author[i]=65+i;
	for(i=0;i<m;i++){
		scanf("%d",&book[i].num);
		gets(book[i].name);
	}
	for(i='A';i<='Z';i++){
		for(j=0;j<m;j++){
			n=strlen(book[j].name);
			for(k=0;k<n;k++){
				if(i==book[j].name[k])
					count[i-65]++;
			}
		}
	}
	for(i=0;i<25;i++){
		if(count[i]>count[i+1]){
			e=count[i];
			count[i]=count[i+1];
			count[i+1]=e;
			e=author[i];
			author[i]=author[i+1];
			author[i+1]=e;
		}
	}
	printf("%c\n%d\n",author[25],count[25]);
	for(i=0;i<m;i++){
		n=strlen(book[i].name);
		for(k=0;k<n;k++){
			if(book[i].name[k]==author[25])
				printf("%d\n",book[i].num);
		}
	}
	return 0;
}
struct tushu
{
	int num;
	char name[26];
	struct tushu *next;
};
struct tushu *creat(int n)
{
	struct tushu *head,*p1,*p2;
	p1=p2=(struct tushu *)malloc(LEN);
	scanf("%d%s",&p1->num,p1->name);
	head=p1;
	int i;
	for(i=1;i<n;i++)
	{
		p1=(struct tushu *)malloc(LEN);
		scanf("%d%s",&p1->num,p1->name);
		p2->next=p1;
		p2=p1;
	}
	p2->next=NULL;
	return(head);
}
int main()
{
	int n,num[26]={0},*p,i,j,max=0;
	char *a;
	scanf("%d",&n);
	struct tushu *head,*p1;
	head=creat(n);
	p=num;
	for(i=0;i<26;i++)
	{
		p1=head;
		a=p1->name;
		while(p1!=NULL)
		{
			for(j=0;*(a+j)!='\0';j++)
			{
	   	    	if(*(a+j)==i+65)
				{
					*(p+i)=*(p+i)+1;
					break;
				}
			}
			p1=p1->next;
			a=p1->name;
		}
	}
	for(i=1;i<26;i++)
	{
		if(*(p+max)<*(p+i)) max=i;
	}
	printf("%c\n",max+65);
	printf("%d\n",*(p+max));
	p1=head;
	a=p1->name;
	while(p1!=NULL)
	{
		for(i=0;*(a+i)!='\0';i++)
		{
			if(*(a+i)==(max+65))
			{
				printf("%d\n",p1->num);
				break;
			}
		}
		p1=p1->next;
		a=p1->name;
	}
return 0;
}
struct a
{
	int num;
	char s[20];
	struct a *next;
}
main()
{
	int n,i,a[26],b[26]={0},t,j,max;

	struct a *p1,*p2,*head;
	scanf("%d",&n);
	head=p1=(struct a *)malloc(L);
	scanf(M,&p1->num,p1->s);
	for(i=1;i<n;i++)
	{
		p2=p1;
		p1=(struct a *)malloc(L);
		p2->next=p1;
		scanf(M,&p1->num,p1->s);
	}
	p1->next=NULL;
	for(i=0;i<26;i++)
		a[i]=65+i;
	for(i=0;i<26;i++)
	{	p1=head;
		while(p1!=NULL)
		{
			for(j=0;p1->s[j]!='\0';j++)
				if(a[i]==p1->s[j])
					b[i]++;
				p1=p1->next;
		}
	
	}
	max=b[0];t=0;
	for(i=1;i<26;i++)
		if(b[i]>max)
		{
			max=b[i];
			t=i;
		}
		printf("%c\n%d\n",a[t],max);
		p1=head;
	while(p1!=NULL)
	{
		for(j=0;p1->s[j]!='\0';j++)
			if(a[t]==p1->s[j])
			{printf("%d\n",p1->num);break;}
		p1=p1->next;
	}
}
int main()
{
struct {
	int num;
	char author[26];
}book[1000];
int shu_num[26],i,j,k,n,max,length;
char max_author;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d %s",&book[i].num,book[i].author);
}
for(k=0;k<26;k++){
	shu_num[k]=0;
}
for(k=0;k<26;k++){
	for(i=0;i<n;i++){
		length=strlen(book[i].author);
		for(j=0;j<length;j++){
			if(book[i].author[j]=='A'+k){
				shu_num[k]++;
			}
		}
	}	
}
max=shu_num[0];
max_author='A';
for(k=0;k<26;k++){
	if(shu_num[k]>max){
	max=shu_num[k];
	max_author='A'+k;
	}
}
printf("%c\n%d\n",max_author,max);
for(i=0;i<n;i++){
	length=strlen(book[i].author);
	for(j=0;j<length;j++){
		if(book[i].author[j]==max_author){
		printf("%d\n",book[i].num);
		}	
	}
}
	return 0;
}
int n;
struct book
{
	int num;
	char name[20];
	struct book *next;
}*p1,*p2;
//????
struct book *creat(void)
{
	struct book *head;
	int i;
	head=0;
	p1=0;
	p2=0;
	scanf("%d",&n);
	for(i=1;i<=n;i++)
	{
		p1=(struct book *)malloc(LEN);
		scanf("%d %s",&p1->num,p1->name);
		if(head==0)
			head=p1;
		else
			p2->next=p1;
		p2=p1;
	}
	p2->next=0;
	return(head);
}
void main()
{
	struct book *head,*p;
	char a[27],*q,c;
	int b[27],i,m,n1=0,max;//??a??????????b?????????????
	for(i=1;i<27;i++)
	{
		a[i]=0;
		b[i]=0;
	}
	head=creat();
	for(p=head;p!=0;p=p->next)//p++???p=p->next
	{
		for(q=p->name;*q!='\0';q++)
		{
			m=0;
			for(i=1;i<=n1;i++)//???????????????????????????????????????1
				if(*q==a[i])
				{
					m=1;
					b[i]++;
					break;
				}
			if(m==0)
			{
				n1++;//??n1???n
				a[n1]=*q;
				b[n1]=1;
			}
		}
	}
	max=b[1];c=a[1];
	for(i=1;i<=n1-1;i++)
		if(b[i]>max)
		{
			c=a[i];
			max=b[i];
		}
	printf("%c\n",c);
	printf("%d\n",max);
	for(p=head;p!=0;p=p->next)
	{
		m=0;
		for(q=p->name;*q!='\0';q++)
			if(*q==c)
			{
				m=1;
				break;
			}
		if(m)
			printf("%d\n",p->num);//?????????
	}
}
int main()
{
    int num,temp;
    int author[27][500]={0,};
    char str[1000];
    cin>>num;
    for(int i=1;i<=num;i++)
    {
        cin>>temp;
        getchar();
        cin>>str;
        for(int j=0;j<strlen(str);j++)
        {
            author[str[j]-'A'+1][0]++;
            author[str[j]-'A'+1][author[str[j]-'A'+1][0]]=temp;
        }
    }
    int temp_num=0,temp_author;
    for(int i=1;i<=26;i++)
    {
        if(author[i][0]>temp_num)
        {
            temp_num=author[i][0];
            temp_author=i;
        }
    }
    cout<<(char)(temp_author+'A'-1)<<endl;
    cout<<temp_num<<endl;
    for(int i=1;i<=temp_num;i++)
    {
        cout<<author[temp_author][i]<<endl;
    }
 
    return 0;
}
void main()
{
	int n,i,j,l,max,p;
	int a[1000];
	scanf("%d",&n);
	struct book
	{
		int m;
		char c[27];
	};
	struct book b[1000];
	for(i=0;i<n;i++)
	{
		scanf("%d",&b[i].m);
		scanf("%s",b[i].c);
	}
	for(i=0;i<26;i++)
		a[i]=0;
	for(i=0;i<n;i++)
	{
		l=strlen(b[i].c);
		for(j=0;j<l;j++)
			a[b[i].c[j]-'A']++;
	}
	max=a[0];
	for(i=0;i<26;i++)
	{
		if(a[i]>max)
			max=a[i];
	}
	for(i=0;i<26;i++)
	{
		if(max==a[i])
			p=i;
	}
	p=p+'A';
	printf("%c\n",p);
	printf("%d\n",max);
	for(i=0;i<n;i++)
	{
		l=strlen(b[i].c);
		for(j=0;j<l;j++)
		{
			if(b[i].c[j]==p)
				printf("%d\n",b[i].m);
		}
	}

}
struct people
{
	int a;
	char name[26];
};	
void main()
{
	struct people pl[1000];
	int i,j,k,l=0,n,s,m,max,x[26];
	scanf("%d",&n);
	for(i=0;i<n;i++) 
	{
		scanf("%d %s",&pl[i].a,pl[i].name);
	}
	for(i=0;i<n;i++)
	{
		m=strlen(pl[i].name);
		for(j=0;j<m;j++)
			for(k=0;k<26;k++)
				if(k==pl[i].name[j]-'A')
				{
					x[k]++;
					break;
				}
	}
	max=x[0];
	for(i=0;i<26;i++)
		if(x[i]>max) max=x[i];
	for(i=0;i<26;i++)
		if(x[i]==max)
		{
			printf("%c\n",'A'+i);
			s=i;
			printf("%d\n",x[i]);
			break;
		}
	for(i=0;i<n;i++)
		for(j=0;j<26;j++)
			if(pl[i].name[j]=='A'+s) 
			{
				printf("%d\n",pl[i].a);
				break;
			}
}
int c[255];

int main()
{
int i,j,n;
char m = 0;
struct {
  int id;
  char s[255];
} a[1000];

scanf("%d", &n);
for (i=0;i<n;i++) {
  scanf("%d%s", &a[i].id, a[i].s);
  for (j=0; a[i].s[j]; j++) {
    if (++c[a[i].s[j]] > c[m])
        m=a[i].s[j];
  }
}
printf("%c\n%d\n", m, c[m]);
for (i=0;i<n;i++) {
  if (strchr(a[i].s, m))
    printf("%d\n", a[i].id);
}
return 0;
}
struct 
{
	int num;
	char au[27];
}book[999];


int main()
{
	int m,a[26]={0},i,j,t,max=0;
	scanf("%d",&m);
	for(i=0;i<m;i++)
	{
		scanf("%d%s",&book[i].num,book[i].au);
		int au_n=strlen(book[i].au);
		for(j=0;j<au_n;j++)
		{
			if(book[i].au[j]<=90&&book[i].au[j]>=65) 
			{
				int k=book[i].au[j]-65;
				a[k]++;
				if(a[k]>max) max=a[k];
			}
		}
	}
	for(i=0;i<26;i++)
	{
		if(a[i]==max) 
		{
			char r=i+65;
			printf("%c\n%d\n",r,max);
			break;
		}
	}
	for(t=0;t<m;t++)
	{
		int au_n=strlen(book[t].au);
		for(j=0;j<au_n;j++)
		{
			if(book[t].au[j]==i+65) printf("%d\n",book[t].num);
		}
	}
	return 0;
}
struct chain
{
	int num;
	char name[27];
	struct chain *next;
};
void main()
{
	int a[26]={0},m,i,j,k,max=0,n;
	struct chain *p1,*p2,*head;
	scanf("%d",&m);
	p2=head=(struct chain *)malloc(LEN);
	for(k=0;k<27;k++)
		head->name[k]=0;
	scanf("%d%s",&head->num,&head->name);
	for(k=0;k<strlen(head->name);k++)
		{
			if(head->name[k]>=65&&head->name[k]<=90)
					a[head->name[k]-65]++;
		}
	for(j=0;j<m-1;j++)
	{
		p1=(struct chain *)malloc(LEN);
		p2->next=p1;
		for(k=0;k<27;k++)
			p1->name[k]=0;
		scanf("%d%s",&p1->num,&p1->name);
		p2=p1;
		for(k=0;k<strlen(p1->name);k++)
		{
			if(p1->name[k]>=65&&p1->name[k]<=90)
					a[p1->name[k]-65]++;
		}
	}
	for(i=0;i<26;i++)
	{
		if(max<a[i])
		{
			max=a[i];
			n=i;
		}
	}
	printf("%c\n%d\n",n+65,max);
	p1=head;
	for(i=0;i<m;i++)
	{
		for(j=0;j<26;j++)
		{
			if(p1->name[j]==(n+65))
			{
				printf("%d\n",p1->num);
				break;
			}
		}
		p1=p1->next;
	}
}
void main()
{
  struct b
  {int n;
  char a[26];
  };
  struct b b[999];
  int m,k,i,j,c[26]={0},p=0,q=0;
  char x;
  scanf("%d",&m);
  for(i=0;i<m;i++)
  scanf("%d%s",&b[i].n,&b[i].a);
for(i=0;i<m;i++)
for(j=0;(x=b[i].a[j])!='\0'&&j<26;j++)
c[x-65]++;
k=c[0];
for(i=0;i<26;i++)
if(c[i]>k){k=c[i];p=i;}
printf("%c\n",p+65);
printf("%d\n",c[p]);
for(i=0;i<m;i++)
{q=0;
for(j=0;(x=b[i].a[j])!='\0'&&j<26;j++)
if(x==p+65)q=1;
if(q==1)printf("%d\n",b[i].n);
}

}
int main()
{
	int m;
	int i, j, a,n;
	struct book{
		int no;
		char name[30];
	}book[999];
	int author1[30]={0}, author2[30]={0};
	char k;
	scanf("%d", &m);
	for(i=0;i<m;i++)
		scanf("%d %s", &book[i].no, &book[i].name);
	for(i=0;i<m;i++){
		a = strlen(book[i].name);
		for(j=0;j<a;j++){
			for(k='A';k<='Z';k++){
				if(book[i].name[j]==k)
					author1[(int)k-65]++;
			}
		}
	}
	for(i=0;i<26;i++)
		author2[i]=author1[i];
	for(i=0;i<26;i++){
		for(j=i+1;j<26;j++){
			if(author1[i]<author1[j]){
				int tmp;
				tmp = author1[i];
				author1[i] = author1[j];
				author1[j]= tmp;
			}
		}
	}
	for(i=0;i<26;i++){
		if(author2[i] == author1[0]){
			printf("%c\n", (char)(65+i));
			printf("%d\n", author1[0]);
			for(j=0;j<m;j++){
				a = strlen(book[j].name);
				for(n=0;n<a;n++){
					if(book[j].name[n]==(char)(65+i)){
						printf("%d\n", book[j].no);
						break;
					}
				}
			}
		}
	}
	return 0;
}
struct book
{
   int num;
   char w[26];
   struct book *next;
};
int c[26],m,i,j=0,max;

struct book *creat(int m)
{
    struct book *head,*p1,*p2;
	p1=(struct book*)malloc(len);
    scanf("%d%s",&p1->num,p1->w);
	p1->next=NULL;
	p2=p1;
	head=p1;
	for(i=1;i<m;i++)
	{
		p1=(struct book*)malloc(len);
        scanf("%d%s",&p1->num,p1->w);
	    p1->next=NULL;
		p2->next=p1;
		p2=p1;
	}
	return head;
}
void a(struct book *head)
{
    struct book *p;
	char *x;
	int l,ch;
    p=head;
	for(i=0;i<m;i++)
	{
		for(x=p->w;x<p->w+26;x++)
		{
              l=(int)*x;
			  ch=l-65;

			  if(ch>=0) c[ch]=c[ch]+1;
		}
		p=p->next;
	}
}
      
void main()
{
	struct book *head,*p;
	struct book *creat(int m);
    void a(struct book *head);
	char writer,*x;
	int wri,b[200];
	for(i=0;i<26;i++) c[i]=0;
	for(i=0;i<200;i++) b[i]=0;
	scanf("%d",&m);
	head=creat(m);
	a(head);
	max=0;
	j=0;
	for(i=0;i<26;i++)
	{
        if(c[i]>max)
		{
		wri=i+65;
		max=c[i];
	
		}
	}
	printf("%c\n",wri);
    p=head;
	for(i=0;i<m;i++)
	{
		for(x=p->w;x<p->w+26;x++)
		{
			if(*x==(char)wri)
			{
				b[j]=p->num;
				j=j+1;
				break;
			}
		}
		p=p->next;
	}
printf("%d\n",j);
for(j=0;b[j]>0;j++) printf("%d\n",b[j]);
  


}
int max,n,x,b[30]={0};
struct book
{
	int num;
	char author[30];
	struct book*next;
};

struct book*creat()
{
	struct book*head,*p1,*p2;
	p2=NULL;
	head=(struct book*)malloc(len);
	p1=head;
	while(n>0)
	{
		char a[30];int i,j;
		p2=p1;
		x=0;
		scanf("%d%s",&p1->num,&p1->author);
		strcpy(a,p1->author);
		max=b[0];
		for(i=0;a[i]!='\0';i++)
		{
			for(j='A';j<='Z';j++)
			{
				if(j==a[i])
				b[j]++;
			}
		}
		for(j='A';j<='Z';j++)
		{
			if(b[j]>max)
			{
				max=b[j];
				x=j;
			}
		}
		p1=(struct book*)malloc(len);
		p2->next=p1;
		n--;
	}
	p2->next=NULL;
	printf("%c\n%d\n",x,max);
	return head;
	
}
struct book*print(struct book*head,char x)
{
	struct book*p1;
	p1=head;
	int i;
	while(p1!=NULL)
	{
		char a[30];
		strcpy(a,p1->author);
		for(i=0;a[i]!='\0';i++)
		{
			if(a[i]==x)
				printf("%d\n",p1->num);
		}
		p1=p1->next;
	}
	return head;
}
void main()
{
	scanf("%d",&n);
	struct book*head;
	head=creat();
	print(head,x);
}
int main(int argc, char* argv[])
{
	int m,i,j,A[26]={0},B[26];
	char s;
	scanf("%d",&m);
	struct book{
		int num;
		char n[26];
	}*book;
    book=(struct book*)malloc(sizeof(struct book)*m);
	for(i=0;i<m;i++)
	{
		scanf("%d %s",&book[i].num,book[i].n);
		for(j=0;book[i].n[j]!='\0';j++)
		{
			switch(book[i].n[j])
			{
			case 65:A[0]++;break;
			case 66:A[1]++;break;
			case 67:A[2]++;break;
			case 68:A[3]++;break;
			case 69:A[4]++;break;
			case 70:A[5]++;break;
			case 71:A[6]++;break;
			case 72:A[7]++;break;
			case 73:A[8]++;break;								
			case 74:A[9]++;break;									
			case 75:A[10]++;break;										
			case 76:A[11]++;break;											
			case 77:A[12]++;break;												
			case 78:A[13]++;break;													
			case 79:A[14]++;break;																					
			case 80:A[15]++;break;															
			case 81:A[16]++;break;																
			case 82:A[17]++;break;																	
			case 83:A[18]++;break;																		
			case 84:A[19]++;break;												
			case 85:A[20]++;break;										    	
			case 86:A[21]++;break;												
			case 87:A[22]++;break;												
			case 88:A[23]++;break;												
			case 89:A[24]++;break;																		
			case 90:A[25]++;break;												
			}
		}
	}
	int k,max;
	//for(i=0;i<26;i++)
	//	printf("%d\n",A[i]);
	for(i=0;i<26;i++)
	{
		B[i]=A[i];
	}
	for(i=25;i>0;i--)
	{
		if(B[i]>B[i-1])
		{
			B[i-1]=B[i];

			max=B[i];
		}
		else
		{
			max=B[i-1];
		}
	}
	for(i=25;i>=0;i--)
	{
		if(A[i]==max)
			k=i;
	}
	//printf("%d",k);
	s=k+65;
	printf("%c\n%d\n",s,max);
	for(i=0;i<m;i++)
	{
		for(j=0;book[i].n[j]!='\0';j++)
		{
			if(book[i].n[j]==s)
			{
				printf("%d\n",book[i].num);
				break;
			}
		}
	}

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

}

void main()
{
	struct student *head;
	struct student *p1;
	char *p2;
	int i;
	int a[26];
	for(i=0;i<26;i++)
	{
		a[i]=0;
	}
	scanf("%d",&n);
	head=creat();
	p1=head;
	do
	{
		p2=p1->name;
		for(;(*p2)!='\0';p2++)
		{
			if((*p2)=='A')
			{
				a[0]=a[0]+1;
			}
			if((*p2)=='B')
			{
				a[1]=a[1]+1;
			}
			if((*p2)=='C')
			{
				a[2]=a[2]+1;
			}if((*p2)=='D')
			{
				a[3]=a[3]+1;
			}if((*p2)=='E')
			{
				a[4]=a[4]+1;
			}if((*p2)=='F')
			{
				a[5]=a[5]+1;
			}if((*p2)=='G')
			{
				a[6]=a[6]+1;
			}if((*p2)=='H')
			{
				a[7]=a[7]+1;
			}if((*p2)=='I')
			{
				a[8]=a[8]+1;
			}if((*p2)=='J')
			{
				a[9]=a[9]+1;
			}if((*p2)=='K')
			{
				a[10]=a[10]+1;
			}if((*p2)=='L')
			{
				a[11]=a[11]+1;
			}if((*p2)=='M')
			{
				a[12]=a[12]+1;
			}if((*p2)=='N')
			{
				a[13]=a[13]+1;
			}if((*p2)=='O')
			{
				a[14]=a[14]+1;
			}if((*p2)=='P')
			{
				a[15]=a[15]+1;
			}if((*p2)=='Q')
			{
				a[16]=a[16]+1;
			}if((*p2)=='R')
			{
				a[17]=a[17]+1;
			}if((*p2)=='S')
			{
				a[18]=a[18]+1;
			}if((*p2)=='T')
			{
				a[19]=a[19]+1;
			}if((*p2)=='U')
			{
				a[20]=a[20]+1;
			}if((*p2)=='V')
			{
				a[21]=a[21]+1;
			}if((*p2)=='W')
			{
				a[22]=a[22]+1;
			}if((*p2)=='X')
			{
				a[23]=a[23]+1;
			}if((*p2)=='Y')
			{
				a[24]=a[24]+1;
			}if((*p2)=='Z')
			{
				a[25]=a[25]+1;
			}
			
		}
		p1=p1->next;
	}while(p1!=NULL);
		int j,max=0;
		for(i=0;i<26;i++)
		{
			if(a[i]>max)
			{
				max=a[i];
				j=i;
			}
		}
	printf("%c\n",j+65);
	printf("%d\n",a[j]);
	p1=head;
	do
	{
		p2=p1->name;
		for(;(*p2)!='\0';p2++)
		{
			if((*p2)==j+65)
			{
				printf("%d\n",p1->num);
			}
		}
		p1=p1->next;
	}while(p1!=NULL);

}
struct book
{
	int num;
	char name[26];
	struct book *next;
};
struct book *creat(int m)
{
	struct book *head,*p1,*p2;
	p1=(struct book *)malloc(sizeof(struct book));
	scanf("%d %s",&p1->num,p1->name);
	int i;
	for(i=1;i<m;i++)
	{
		if(i==1) head=p1;
		else p2->next=p1;
		p2=p1;
		p1=(struct book *)malloc(sizeof(struct book));
		scanf("%d %s",&p1->num,p1->name);
	}
	p2->next=p1;p1->next=NULL;
	return(head);
}
main()
{
	struct book *head,*p;
	int i,j,m,k,l,max=0;
	scanf("%d",&m);
	head=creat(m);
	int *a;
	a=(int *)malloc(26*sizeof(int));
	for(i=0;i<26;i++)
		*(a+i)=0;
	p=head;
	for(i=0;i<m;i++)
	{
		k=strlen(p->name);
		for(j=0;j<k;j++)
			for(l=0;l<26;l++)
				if(*(p->name+j)==l+65)
					(*(a+l))++;
		p=p->next;
	}
	for(i=0;i<26;i++)
		if(max<*(a+i)) max=*(a+i);
	for(i=0;i<26;i++)
		if(max==*(a+i)) {printf("%c\n%d\n",i+65,max);break;}
	p=head;
	for(j=0;j<m;j++)
	{
		k=strlen(p->name);
		for(l=0;l<k;l++)
			if(*(p->name+l)==i+65)
				printf("%d\n",p->num);
		p=p->next;
	}
}
struct BOOK
{
	int No;
	char author[27];
}book[999];
int letter[26]={0};

main()
{
	int letter[26]={0};
	int count=0;
	int m,n,s;
	scanf("%d",&m); 
	int i,j,max;
	for(i=0;i<m;i++){
		scanf("%d%s",&book[i].No,&book[i].author);
	}
	for(i=0;i<m;i++){
		for(j=0;j<strlen(book[i].author);j++){
			n=book[i].author[j]-65;
			letter[n]++;
		}
	}
	max=letter[0];
	for(n=0;n<26;n++){
		if(letter[n]>max){
			max=letter[n];
		}
	}
	for(n=0;n<26;n++){
		if(max==letter[n]){
			s=n;
			printf("%c\n%d\n",n+65,max);
			break;
		}
	}
	for(i=0;i<m;i++){
		for(j=0;j<strlen(book[i].author);j++){
			if(s==book[i].author[j]-65){
				printf("%d\n",book[i].No);
			}
		}
	}
}
struct Book
{
	int number;
	char author[30];
};

void main()
{
	int max=0,len;
	int sum[30]={0};
	int m,i,j;
	struct Book book[999];
	scanf("%d",&m);
	for(i=0;i<m;i++)
	{
		scanf("%d %s",&book[i].number,book[i].author);
		len=strlen(book[i].author);
		for(j=0;j<len;j++)
			sum[book[i].author[j]-65]++;
	}
	for(i=0;i<26;i++)
	{
		if(sum[i]>sum[max])
			max=i;
	}
	printf("%c\n%d\n",max+65,sum[max]);
	for(i=0;i<m;i++)
	{
		len=strlen(book[i].author);
		for(j=0;j<len;j++)
		{
			if(book[i].author[j]==max+65)
			{
				printf("%d\n",book[i].number);
				break;
			}
		}
	}
}
void main()
{
	int n,i,j,no[1000],shu[26]={0},max=0;
	char s[1000][20],c;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d%s",&no[i],s[i]);
		for(j=0;j<strlen(s[i]);j++)
		{
			shu[s[i][j]-'A']++;
		}
	}
	for(i=0;i<26;i++)
	{
		if(shu[i]>max)
		{
			max=shu[i];
			c='A'+i;
		}
	}
	printf("%c\n%d\n",c,max);
	for(i=0;i<n;i++)
	{
		if(strchr(s[i],c))
			printf("%d\n",no[i]);
	}
}
int main ()
{
	int m, i, j, k, n, max, l, y = 0;
	struct book
	{
		int num;
		char aut[26];
	}book[1000];
	int a[26] = {0};
	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'};
	scanf ("%d", &m);
	for (i = 0; i < m; i++)
	{
		scanf ("%d %s", &book[i].num, book[i].aut);
	}



	for (i = 0; i < 26; i++)
	{
		for (j = 0; j < m; j++)
		{
			l = strlen(book[j].aut);
			for (k = 0; k < l; k++)
			{
				if (book[j].aut[k] == b[i])
				{
					a[i]++;
				}
			}
		}
	}

    
	for (i = m; i > 0; i--)
	{
		for (j = 0; j < 26; j++)
		{
			if (a[j] == i)
			{
				max = a[j];
				n = j;
				printf("%c\n", b[j]);
				printf ("%d\n", a[j]);
				y = 1;
				break;
			}
		}
		if (y == 1)
		{
			break;
		}
	}



	for (i = 0; i < m; i++)
	{
		l = strlen(book[i].aut);
		for (j = 0; j < l; j++)
		{
			if (book[i].aut[j] == b[n])
			{
				printf("%d\n", book[i].num);
			}
		}
	}
	return 0;
}
struct book
{
	long int num;
	char name[26];
}book[1000];
int main()
{
	int m,i,j,r;
	int writer[26]={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};
	scanf("%d",&m);
    for(i=0;i<m;i++)
	{
       scanf("%ld ",&book[i].num);
	   scanf("%s",book[i].name);
	}
    for(i=0;i<m;i++)
	{
		r=strlen(book[i].name);
		for(j=0;j<r;j++)
		{
				writer[book[i].name[j]-'A']++;
		}
	}
	int max=0;
	char w='A';
	for(i=0;i<26;i++)
	{
		if(writer[i]>max)
		{
			max=writer[i];
			w=i+'A';
		}
	}    
	printf("%c\n",w);
	printf("%d\n",max);
	for(i=0;i<m;i++)
	{
		for(j=0;j<r;j++)
		{
			r=strlen(book[i].name);
			if(book[i].name[j]==w)
			{
				printf("%ld\n",book[i].num);
			}
		}
	}
	return 0;
}
int main()
{
	struct book
	{
		int num;
		char author[26];
	}list[999],*p;

	int n;
	int count[26]={0};
	int i;
	char k='A';
	int max;

	scanf("%d",&n);
	for(p=list;p<list+n;p++){
		scanf("%d %s",&p->num,p->author);
	}

	for(p=list;p<list+n;p++){
		for(i=0;;i++){
			if(p->author[i]=='\0'){
				break;
			}else{
				count[p->author[i]-65]++;
			}
		}
	}

	max=count[0];          
	for(i=1;i<26;i++){
		if(count[i]>max){
			max=count[i];
			k=i+65;
		}
	}

	printf("%c\n",k);
	printf("%d\n",max);

	for(p=list;p<list+n;p++){
		for(i=0;;i++){
			if(k==p->author[i]){
				printf("%d\n",p->num);
			}
			if(p->author[i]=='\0'){
				break;
			}
		}
	}

	return 0;
}
struct book
{
	int num;
	char ren[26];
}
main()
{
	struct book shu[999];
	int m,i,j,k,max=0,p;
	int a[26]={0};
	scanf("%d",&m);
	for(i=0;i<m;i++)
	{
		scanf("%d %s",&shu[i].num,shu[i].ren);
		for(j=0;shu[i].ren[j]!='\0';j++)
			for(k=65;k<91;k++)
			if(shu[i].ren[j]==k)
				a[k-65]++;
	}
	for(i=0;i<26;i++)
		if(max<a[i])
			max=a[i];
	for(i=0;i<26;i++)
		if(max==a[i])
		{
			p=i+65;
			printf("%c\n%d\n",p,a[p-65]);
		}
	for(i=0;i<m;i++)
		for(j=0;shu[i].ren[j]!='\0';j++)
			if(p==shu[i].ren[j])
				printf("%d\n",shu[i].num);
}
int main()
{
	char book[1000][20]={'\0'},name[1000][30]={'\0'};
	int length,n,i,j,number[30]={0},memory,largest,temp;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%s %s",book[i],name[i]);
	}
	for(i=0;i<n;i++)
	{
		length=strlen(name[i]);
		for(j=0;j<length;j++)
		{
			temp=name[i][j]-'A';
			number[temp]+=1;
		}
	}
	largest=0;
	for(i=0;i<26;i++)
	{
		if(number[i]>largest)
		{
			largest=number[i];
			memory=i;
		}
	}
	printf("%c\n%d\n",'A'+memory,number[memory]);
	for(i=0;i<n;i++)
	{
		length=strlen(name[i]);
		for(j=0;j<length;j++)
		{
			if(name[i][j]=='A'+memory)
			{
				printf("%s\n",book[i]);
			}
		}
	}
	return 0;
}
int main()
{
    
	struct
	{
		int m;
		char s[26];
	}p[999];

	int i,j,len,n;
	int a[26][1000]={0};
	int w,t;

	scanf("%d\n",&n);
	

	for(i=0;i<n;i++)
	{
	    scanf("%d %s",&p[i].m,p[i].s);
		len=strlen(p[i].s);		
        for(j=0;j<len;j++)		
		{
			t=(p[i].s)[j]-'A';
			a[t][0]+=1;
			w=a[t][0];
			a[t][w]=p[i].m;
		}		
	}
    
	int max=a[0][0];
	int k=0;
	for(i=1;i<26;i++)
	{
		if(a[i][0]>max)
		{
			max=a[i][0];
			k=i;
		}
    }

	printf("%c\n",k+'A');
    printf("%d\n",max);
    for(i=1;i<=max;i++)
	{
        printf("%d\n",a[k][i]);
	}
	 return 0;
}