semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
struct shu
{
	int bianhao;
	char name[26];
}shu[999];

int main ()
{
	int m;
	scanf("%d",&m);
	int i,j,k;
	int jishu[26]={0};
	int beiyong[26];
	for (i=0;i<m;i++)
		scanf("%d %s",&shu[i].bianhao,shu[i].name);
    for (i=0;i<26;i++)
	{
		for (j=0;j<m;j++)
		{
			for (k=0;k<26;k++)
			{
				if (shu[j].name[k]==i+'A')
					jishu[i]++;
			}
		}
	}
	for (i=0;i<26;i++)
		beiyong[i]=jishu[i];
	int max=0;
	for (i=0;i<26;i++)
	{
		if (beiyong[i]>max)
			max=beiyong[i];
	}
	int t;
	for (i=0;i<26;i++)
	{
		if (jishu[i]==max)
			t=i;
	}
	printf("%c\n",t+'A');
	printf("%d\n",max);
	for (i=0;i<m;i++)
	{
		for (j=0;j<26;j++)
		{
			if (shu[i].name[j]==t+'A')
				printf("%d\n",shu[i].bianhao);
		}
	}
}
struct book
{
	int num;
	char name[100];
	struct book *next;
};

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

int main(void)
{
	struct book *head,*p;
	char *q;
	int *s;
	int n,i,j,max=0;
	s=(int *)malloc(26*sizeof(int));
	for(i=0;i<26;i++)
		*(s+i)=0;
	scanf("%d",&n);
	head=creat(n);
	p=head;
	while(p)
	{
		q=p->name;
		while(*q!='\0')
		{   *(s+*(q)-'A')+=1;q++;}
		p=p->next;
	}
	max=0;
	for(i=0;i<26;i++)
	    if(*(s+i)>max)
			max=*(s+i);
	for(i=0;i<26;i++)
	    if(*(s+i)==max) break;
	printf("%c\n%d\n",'A'+i,max);
	p=head;
	while(p)
	{
		q=p->name;
		if(strchr(q,'A'+i)!=NULL)
			printf("%d\n",p->num);
		p=p->next;
	}
}
int main()
{
	int n, i;
	scanf("%d", &n);
	struct 
	{
		int name;
		char author[26];
	}
	book[999];

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

	char t, tmax;
	int max = 0, j, k;
	for(t = 'A'; t <= 'Z'; t++)
	{
		k = 0;
		for(i = 0; i < n; i++)
		{
			for(j = 0; j < strlen(book[i].author); j++)
			{
				if(book[i].author[j] == t)
				{
					k++;
				}
			}
		}
		if(k > max)
		{
			max = k;
			tmax = t;
		}
	}
	printf("%c\n%d\n", tmax, max);
	for(i = 0; i < n; i++)
	{
		for(j = 0; j < strlen(book[i].author); j++)
		{
			if(book[i].author[j] == tmax)
			{
					printf("%d\n", book[i].name);
					break;
			}
		}
	}
	return 0;
}
void main()
{
int n,i,j,max=0,seq=0;
int a[26]={0};

scanf("%d",&n);
struct book
{
int num;
char str[26];
}book[999];

for(i=0;i<n;i++)
scanf("%d %s",&book[i].num,&book[i].str);

for(i=0;i<n;i++)
{
	for(j=0;j<26;j++)
	a[(book[i].str[j]-65)]++;
}

for(i=0;i<26;i++)
	if (a[i]>max) {max=a[i];seq=i;}

printf("%c\n",seq+65);
printf("%d\n",max);

for(i=0;i<n;i++)
{
for(j=0;j<26;j++)
if (book[i].str[j]==seq+65) {printf("%d\n",book[i].num); break;}
}


}
int main()
{
	int m, book[1002], i, cnt[26] = {0}, l, j, n = 0;
	char name[1002][27], a, max ;
	cin >> m;
	for (i = 0; i < m; i++)
	{
		cin >> book[i];
		cin >> name[i];
		l = strlen(name[i]);
		for (j = 0; j < l; j++)
		{
			a = name[i][j];
			cnt[a - 'A']++;
		}
	}
	for (i = 0; i < 26; i++)
		{
			if (cnt[i] > n)
			{
				n = cnt[i];
				max = i + 'A';
			}
		}
		cout << max << endl;
		cout << n << endl;
		for (i = 0; i < m; i++)
		{
			l = strlen (name[i]);
			for (j = 0; j < l; j++)
			{
				if (name[i][j] == max)
				{
					cout << book[i] << endl;
					break;
				}
			}
		}
	return 0;
}
int main()
{
	int n, i, j, k, f=0, c, d;
	struct aut
	{ int num;
	  char wrt[26];
	}a[999];
    char wr[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 g[26]={0};
	scanf("%d",&n);
    for(i=0;i<n;i++)
	{
		scanf("%d%s",&a[i].num,a[i].wrt);
		c=strlen(a[i].wrt);
        for(j=0;j<c;j++)
		{
			for(k=0;k<26;k++)
			{
				if(a[i].wrt[j]==wr[k]) g[k]=g[k]+1;
			}
		}
	}
	for(i=0;i<26;i++)
	{
      if(f<g[i])
	  { 
		  f=g[i];
	      d=i;
	  }
	}

	printf("%c\n%d\n",wr[d],f);
	for(i=0;i<n;i++)
	{
        c=strlen(a[i].wrt);
		for(j=0;j<c;j++)
		{
			if(a[i].wrt[j]==wr[d])
			{
				printf("%d\n",a[i].num);
				break;
			}
		}
	}
	return 0;
}
struct b
{
	int na;
	char au[20];
}book[1000];
int main()
{
	int m,i,len[1000],num[128]={0},j,max,p=0;
	char maxi;
	int boo[1000];
	scanf("%d",&m);
	for(i=0;i<m;i++)
	{
		scanf("%d%s",&book[i].na,book[i].au);
		len[i]=strlen(book[i].au);
		for(j=0;j<len[i];j++)
			num[book[i].au[j]]++;
	}
	maxi='A';
	max=-1;
	for(j='A';j<='Z';j++)
	{
		if(num[j]>max)
		{
			max=num[j];
			maxi=j;
		}
	}
	printf("%c\n",maxi);
	printf("%d\n",max);
	for(i=0;i<m&&p<max;i++)
	{
		for(j=0;j<len[i];j++)
		{
			if(book[i].au[j]==maxi)
			{
				printf("%d\n",book[i].na);
				p++;
				break;
			}
		}
	}
	return 0;
}
struct book
	{
		char id[11];
		char name[30];
	};
struct au
{
	int num;
	char id[1000][11];
};
void main()
{
	struct book b;
	struct au a[26];
	int n,i,j=0,k;
	char c;
	for(i=0;i<26;i++)
		a[i].num=0;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%s%s",b.id,b.name);
		while(b.name[j]!='\0')
		{
			k=b.name[j]-'A';
			strcpy(a[k].id[a[k].num],b.id);
			a[k].num++;
			j++;
		}
		j=0;
	}
	k=0;
	j=0;
	for(i=0;i<26;i++)
	{
		j=(a[i].num>k)? i:j;
		k=(a[i].num>k)? a[i].num:k;
	}
	printf("%c\n",'A'+j);
	printf("%d\n",k);
	for(i=0;i<k;i++)
		printf("%s\n",a[j].id[i]);
}
struct book
{
	int num;
	char wr[26];
};
int main()
{	
	int n,b[91][1000],max=0,i,j,k,s,m,writer;
	struct book bk[1000];
	scanf("%d",&n);//??????//
	for(i=0;i<n;i++)
	{
		scanf("%d%s",&bk[i].num,bk[i].wr);
	}//?????????//
	for(i=0;i<26;i++)//?????//
	{
		s=0;
		for(j=0;j<n;j++)//???????i???//
		{
			m=strlen(bk[j].wr);//??????//
			for(k=0;k<m;k++)
			{
				if(bk[j].wr[k]==i+65)
				{
					b[i][s]=bk[j].num;//??i+65??s+1?????//
					s++;
					k=m;
				}
			}
		}
		if(s>max)//s???i?????//
		{
			max=s;
			writer=i;
		}
	}
	printf("%c\n%d",writer+65,max);
	for(i=0;i<max;i++)
		printf("\n%d",b[writer][i]);
	return 0;
}
struct student
{
	int num;
	char s[100];
	struct student *next;
};
void main()
{
	struct student *p1,*p2,*head;
	int n,i,j,k,m,a[100];
	char c[100],nam[100][100];					
	for(i=0;i<26;i++)
	{	c[i]=i+65;	a[i]=0;}						//??
	scanf("%d",&n);
	p1=p2=head=(struct student*)malloc(LEN);
	scanf("%d %s",&p1->num,p1->s);
	for(i=1;i<n;i++)
	{
		p1=(struct student*)malloc(LEN);
		scanf("%d %s",&p1->num,p1->s);
		p2->next=p1;
		p2=p1;
	}
	p2->next=NULL;
	p1=head;
	i=0;
	while(p1!=NULL)
	{
		strcpy(nam[i],p1->s);
		i++;
		p1=p1->next;
	}
	p1=head;
	for(k=0;k<n;k++)
	{
		//printf("%s\n",nam[k]);//????????nam[k]????????????????????????????????????????????//???
		for(i=0;i<26;i++)
		{
			for(j=0;nam[k][j]!='\0';j++)
				if(nam[k][j]==c[i])
					a[i]++;
		}
		
	}
	k=a[0];
		for(i=0;i<26;i++)
		{
			if(a[i]>k)
				k=a[i];
		}
		for(i=0;i<26;i++)
		{
			if(a[i]==k)
			{	printf("%c\n%d",c[i],a[i]);
				m=i;
				break;
			}
		}
		p1=head;
		for(i=0;i<n;i++)
		{
			for(j=0;nam[i][j]!='\0';j++)
			{
				if(nam[i][j]==c[m])
					printf("\n%d",p1->num);
			}
			p1=p1->next;

		}
		

}
struct 
{
	int num;
   	char name[27];
}book[999];
struct
{
	int cishu;
}ren[26];
int main()
{
	int n,zimu,a,b,i,j;
	int sz[26];
	char m;
	scanf("%d",&n);
    for(i=0;i<n;i++)
	{
		scanf("%d %s",&book[i].num,book[i].name);
	}
    for(i=0;i<n;i++)
	{
		for(j=0;book[i].name[j]!='\0';j++)
		{
			   zimu=book[i].name[j]-65;
			   ren[zimu].cishu++;
		}
	}
	a=0;
	b=ren[0].cishu;
    for(i=1;i<26;i++)
	{
       if(ren[i].cishu>b) 
	   {
		   a=i;
		   b=ren[i].cishu;
	   }

	}
    m=a+65;
	printf("%c\n",m);
	printf("%d\n",b);
    for(i=0;i<n;i++)
	{
		for(j=0;j<26;j++)
		{
			if(book[i].name[j]==m)
			{
			   printf("%d\n",book[i].num);
			}
		}
	}

	return 0;
}
main()
{
      int n,i,j,max=0,maxp;
      scanf("%d",&n);
      int a[n];
      int person[26]={0};
      char writer[n][26];
      for (i=0;i<n;i++)
      {
          scanf("%d %s",&a[i],writer[i]);
          for (j=0;j<strlen(writer[i]);j++)
          {
              person[writer[i][j]-'A']++;
          }
      }
      for (i=0;i<26;i++)
      {
          if (max<person[i])
          {
                            max=person[i];
                            maxp=i;
          }
      }
      printf("%c\n%d\n",maxp+'A',max);
      for(i=0;i<n;i++)
                      for(j=0;j<strlen(writer[i]);j++)
                      {
                                                      if (writer[i][j]=='A'+maxp)
                                                      printf("%d\n",a[i]);
                      } 
}
int a=0,b=0,c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;
int max = 0;
char maxn;
struct book
{
	int id;
	char author[28];
}*bb;
void find ( int ii );


int main()
{
	int n;
	scanf("%d",&n);
	int ii;
	bb = ( struct book * ) malloc ( sizeof ( struct book ) * n );
	for ( ii = 0; ii < n ; ii++ )
	{
		scanf("%d %s",&bb[ii].id,bb[ii].author);
	}
	for ( ii = 0 ; ii < n ; ii++ )
	{
		find (ii);
	}
	printf("%c\n",maxn);
	printf("%d\n",max);

	int jj;
	for ( ii = 0 ; ii < n ; ii++ )
	{
		for ( jj = 0 ; bb[ii].author[jj] != '\0' ; jj++)
		{
			if ( bb[ii].author[jj] == maxn )
			{
				printf("%d\n",bb[ii].id);
			}
		}
	}
	free(bb);
	return 0;
}

		







void find ( int ii )
{
	int aa = 0;
	for ( aa = 0 ; bb[ii].author[aa] != '\0' ; aa++ )
	{
		switch(bb[ii].author[aa])
		{
case 'A':{a++;if ( a > max ) max = a,maxn = 'A' ; break;}
case 'B':{b++;if ( b > max ) max = b,maxn = 'B' ; break;}
case 'C':{c++;if ( c > max ) max = c,maxn = 'C' ; break;}
case 'D':{d++;if ( d > max ) max = d,maxn = 'D' ; break;}
case 'E':{e++;if ( e > max ) max = e,maxn = 'E' ; break;}
case 'F':{f++;if ( f > max ) max = f,maxn = 'F' ; break;}
case 'G':{g++;if ( g > max ) max = g,maxn = 'G' ; break;}
case 'H':{h++;if ( h > max ) max = h,maxn = 'H' ; break;}
case 'I':{i++;if ( i > max ) max = i,maxn = 'I' ; break;}
case 'J':{j++;if ( j > max ) max = j,maxn = 'J' ; break;}
case 'K':{k++;if ( k > max ) max = k,maxn = 'K' ; break;}
case 'L':{l++;if ( l > max ) max = l,maxn = 'L' ; break;}
case 'M':{m++;if ( m > max ) max = m,maxn = 'M' ; break;}
case 'N':{n++;if ( n > max ) max = n,maxn = 'N' ; break;}
case 'O':{o++;if ( o > max ) max = o,maxn = 'O' ; break;}
case 'P':{p++;if ( p > max ) max = p,maxn = 'P' ; break;}
case 'Q':{q++;if ( q > max ) max = q,maxn = 'Q' ; break;}
case 'R':{r++;if ( r > max ) max = r,maxn = 'R' ; break;}
case 'S':{s++;if ( s > max ) max = s,maxn = 'S' ; break;}
case 'T':{t++;if ( t > max ) max = t,maxn = 'T' ; break;}
case 'U':{u++;if ( u > max ) max = u,maxn = 'U' ; break;}
case 'V':{v++;if ( v > max ) max = v,maxn = 'V' ; break;}
case 'W':{w++;if ( w > max ) max = w,maxn = 'W' ; break;}
case 'X':{x++;if ( x > max ) max = x,maxn = 'X' ; break;}
case 'Y':{y++;if ( y > max ) max = y,maxn = 'Y' ; break;}
case 'Z':{z++;if ( z > max ) max = z,maxn = 'Z' ; break;}
		}
	}
}
void main()
{
	int i,n,t[27],max;
	char p,a[100][27],b[100][27];
	scanf("%d",&n);
	for(i=1;i<=26;i++) t[i]=0;
	for(i=1;i<=n;i++) scanf("%s%s",a[i],b[i]);
	for(p='A';p<='Z';p++)
		for(i=1;i<=n;i++)
			if(strchr(b[i],p)) t[p-'A'+1]++;
	max=1;
	for(i=2;i<=26;i++)
		if(t[max]<t[i]) max=i;
	printf("%c\n",p='A'+max-1);
    printf("%d\n",t[p-'A'+1]);
	for(i=1;i<=n;i++)
		if(strchr(b[i],p)) printf("%s\n",a[i]);
}
int main()
{
     int i,j,k,t,m,c[26]={0},max=0;
     char b[27]={"ABCDEFGHIJKLMNOPQRSTUVWXYZ"};
     struct book    
    {
       int num;
       char man[26];
    }a[999];
    scanf("%d",&m);
    for(i=0;i<m;i++)
    {
          scanf("%d %s",&a[i].num,a[i].man);
     }
     i=0;
     for(i=0;i<m;i++)
     {
          for(j=0;j<26;j++)
          {
              for(k=0;k<26;k++)
              {
                   if(a[i].man[j]==b[k])
                        c[k]=c[k]+1;
               }
          }
     }
     i=0;j=0;k=0;
     for(i=0;i<26;i++)
     {
          if(c[i]>max)
          {
               max=c[i];
               t=i;
           }
      }
      printf("%c\n%d\n",b[t],max);
      for(j=0;j<m;j++)
      {
            for(k=0;k<26;k++)
            {
                   if(a[j].man[k]==b[t])
                   printf("%d\n",a[j].num);
             }
      }
      
}
struct book{
	int num;
	char s[27];
};

struct author{
	int num;
	int bn[1000];
};

int main()
{
	int m,i,j,l,max=0;

	char c;

	struct book bk[1000];
	struct author au['Z'+1],t;

	scanf("%d",&m);
  for(j=0;j<'Z'+1;j++)
		au[j].num=0;
	for(i=0;i<m;i++)
	{
		
		scanf("%d %s",&bk[i].num,bk[i].s);
		
		l=strlen(bk[i].s);
	
      
		for(j=0;j<l;j++)
		au[bk[i].s[j]].bn[au[bk[i].s[j]].num++]=bk[i].num;
	}

    
	for(j=0;j<'Z'+1;j++)
		if(au[j].num>max)
		{	t=au[j];
		c=j;
		max=au[j].num;}

	printf("%c\n",c);
	printf("%d\n",t.num);

	for(i=0;i<t.num;i++)
		printf("%d\n",t.bn[i]);

	return 0;
}
int N;

struct stu
{
  int num;
  char au[50];
  struct stu *next;

};

struct stu *creat() //????
{
  struct stu *p1,*p2,*head;
  int i;
  
  for(i=0;i<N;i++)
  {
    p2=p1;
	p1=Z;
    scanf("%d%s",&p1->num,p1->au);
    p1->next=0;
	if(i==0) head=p1;
	else p2->next=p1;
  }

  return head;

  
}

void main()
{
  struct stu *head,*p;
  int i,n,j,max,max1;
  int c[26]={0};          //?????????????c[i]??ASC??i+A????????
  int d[26][1000]={0};    //??????????????d[i]??ASC??i+A???????
  int e[26]={0};          //??1???e[],????????d[]???????????????????
    

  scanf("%d",&N);
  head=creat();

  for(p=head;p!=0;p=p->next)
  {
      n=strlen(p->au);
	  for(i=0,j=0;i<n;i++)
	  {
	    c[p->au[i]-'A']++;
		d[p->au[i]-'A'][e[p->au[i]-'A']++]=p->num;  //??2??e[]?????j???????j????????0
	        
	  }

  }

  for(i=0,max=0;i<26;i++)
  {
	  if(max<c[i]) 
	  {
		  max1=i;
		  max=c[i];   //??3?????????????max????????????0
	  }
  }

  printf("%c\n",max1+'A');   //??3??????
  printf("%d\n",c[max1]);    //??4???????????
  i=0;
  while(d[max1][i]!=0)
    printf("%d\n",d[max1][i++]);



}
struct shu
{
	int num;
	char a[26];
	struct shu*next;
};
int main()
{
	char ma='A';
	struct shu *p1,*p2;
	struct shu*head,*p;
	int cnt[128]={0};
	int i,j,n,m;
	scanf("%d",&n);
	p1=p2=(struct shu*)malloc(l);
	scanf("%d%s",&p1->num,p1->a);
	m=strlen(p1->a);
	for(j=0;j<m;j++){
		if(++cnt[p1->a[j]]>cnt[ma])
			ma=p1->a[j];
	}
	head=NULL;
	for(i=1;i<n;i++){
		if(i==1)head=p1;
		else p2->next=p1;
		p2=p1;
		p1=(struct shu*)malloc(l);
		scanf("%d%s",&p1->num,p1->a);
		m=strlen(p1->a);
		for(j=0;j<m;j++){
			if(++cnt[p1->a[j]]>cnt[ma])
				ma=p1->a[j];
		}
	}
	p2->next=p1;
	p2=p1;
	p2->next=NULL;
	p=head;
	printf("%c\n%d\n",ma,cnt[ma]);
	while(p!=NULL){
		m=strlen(p->a);
		for(i=0;i<m;i++){
			if(p->a[i]==ma){
			printf("%d\n",p->num);
			break;
			}
		}
		p=p->next;
	}
	return 0;
}
struct BOOK
{
	int num;
	char name[26];
	int name_num[26];
}book[999];

void main()
{
	int n;                                  //????//
	scanf("%d",&n);
	int i;
	for(i=0;i<n;i++){
		scanf("%d%s",&book[i].num,&book[i].name);    //??????????????????i??j????????????//
	}

	int count[26]={0};
	int k;
	for(i=0;i<n;i++){
		int len;
		len=strlen(book[i].name);
		for(k=0;k<len;k++){
			book[i].name_num[k]=(int)book[i].name[k];
		}
	}

	int j;
	int y;
	for(i=0;i<n;i++){
		int len_1;
		len_1=strlen(book[i].name);
		for(j=65;j<=90;j++){
			for(y=0;y<len_1;y++){
				if(book[i].name_num[y]==j){
					count[j-65]++;
				}
			}
		}
	}
	
	int w;
	int max=count[0];
	int t=0;
	for(w=0;w<26;w++){
		if(count[w]>max){
			max=count[w];
			t=w;
		}
	}
	printf("%c\n%d\n",t+65,max);

	int x;
	int total=0;
	for(i=0;i<n;i++){
		int length;
		length=strlen(book[i].name);
		for(x=0;x<length;x++){
			if(book[i].name_num[x]==t+65){
				printf("%d\n",book[i].num);
			}
		}
	}

	
}
struct author{
int sumbook;
int id[999];
}a[26];

int main(){
    int n,i,j,bookid=0,pos=0,maxbook=0,maxid=0;
    char booka[26];
    scanf("%d",&n);
    for(i=0;i<n;++i){
        scanf("%d%s",&bookid,booka);
        for(j=0;j<strlen(booka);++j){
            pos=booka[j]-'A';
            a[pos].id[a[pos].sumbook]=bookid;
            a[pos].sumbook++;
            if(maxbook<a[pos].sumbook){
               maxid=pos;
               maxbook=a[pos].sumbook;
            }
        }
    }
    printf("%c\n%d\n",maxid+'A',maxbook);
    for(i=0;i<a[maxid].sumbook;i++)
     printf("%d\n",a[maxid].id[i]);
}
struct author {
	char id;
	int count;
	int books[1000];
};

int cmp(const void *a, const void *b) {
	const struct author *pa = (const struct author *) a;
	const struct author *pb = (const struct author *) b;
	return pb->count - pa->count;
}

int main() {
	int i, j, num, id, len, idx;
	struct author authors[26]; // 'A' -- 'Z'
	char c;
	char buffer[26];

	for (i = 0; i < 26; ++i) {
		authors[i].id = 'A' + i;
		authors[i].count = 0;
	}

	scanf("%d", &num);
	for (i = 0; i < num; ++i) {
		scanf("%d %s", &id, buffer);
		len = strlen(buffer);
		for (j = 0; j < len; ++j) {
			idx = buffer[j] - 'A';
			authors[idx].books[authors[idx].count] = id;
			authors[idx].count++;
		}
	}

	qsort(authors, 26, sizeof(struct author), cmp);

	printf("%c\n", authors[0].id);
	printf("%d\n", authors[0].count);
	for (i = 0; i < authors[0].count; ++i)
		printf("%d\n", authors[0].books[i]);
}
int main()
{
	struct bookst
	{
		int Num;
		char name[26];
	};
	struct bookst *book;
	int cnt[26], num, i, j, max=0, max_idx=0;
	for(i=0;i<26;i++)
		cnt[i]=0;
	scanf("%d",&num);
	book=(struct bookst *)malloc(num*sizeof(struct bookst));
	for(i=0;i<num;i++)
	{
		scanf("%d%s",&book[i].Num,book[i].name);
		for(j=0;book[i].name[j]!=0;j++)
		{
			cnt[book[i].name[j]-'A']++;
		}
	}
	for(i=0;i<26;i++)
	{
		if(cnt[i]>max)
		{
			max=cnt[i];
			max_idx=i;
		}
	}
	printf("%c\n%d\n",'A'+max_idx,max);
	for(i=0;i<num;i++)
	{
		for(j=0;book[i].name[j]!=0;j++)
		{
			if(book[i].name[j]=='A'+max_idx)
				printf("%d\n",book[i].Num);
		}
	}
	return 0;
}
struct list
{
       int book;
       char name[30];
};


int main(int argc, char *argv[])
{
  int n,i,j;
  scanf("%d",&n);
  int a[26];
  struct list shelf[n];
  for (i=0;i<=25;i++)
      a[i]=0;
  for (i=0;i<=n-1;i++)
  {
      scanf("%d%s",&shelf[i].book,shelf[i].name);
      for (j=0;j<=strlen(shelf[i].name)-1;j++)
          a[shelf[i].name[j]-'A']++;
  }
  int max,flag=0,add=0,temp=0;
  max=a[0];
  for (i=0;i<=25;i++)
  {
      if (max<a[i])
      {max=a[i];flag=i;}
  }
  printf("%c\n",flag+'A');
  printf("%d\n",max);
  for (i=0;i<=n-1;i++)
  {
      for (j=0;j<=strlen(shelf[i].name)-1;j++)
      {
          if (shelf[i].name[j]==flag+'A')
          add++;
      }
  }
  for (i=0;i<=n-1;i++)
  {
      for (j=0;j<=strlen(shelf[i].name)-1;j++)
      {
          if (shelf[i].name[j]==flag+'A')
          {printf("%d",shelf[i].book);
          temp++;
          (temp<add)?printf("\n"):printf("");
          break;
          }
      }
  }
  return 0;
}
int main()
{
	int n,len,i,j,book[1000],num[26]={0},k=0,t,m=0;
	char w[1000][27],c='A';
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d %s",&book[i],w[i]);
		len=strlen(w[i]);
		for(j=0;j<len;j++)
		{
			for(c='A',t=0;c<='Z';c++)
			{
				if(w[i][j]==c)
				{
					num[t]++;
					break;
				}
				t++;
			}
		}
	}
    for(i=0;i<26;i++)
	{
		if(num[i]>m)
		{
			m=num[i];
			k=i;
		}
	}
	c='A'+k;
	printf("%c\n",c);
	printf("%d\n",num[k]);
	for(i=0;i<n;i++)
	{
        len=strlen(w[i]);
		for(j=0;j<len;j++)
		{
			if(w[i][j]==c)
			{
				printf("%d\n",book[i]);
				break;
			}
		}
	}
	return 0;
}
struct shu
{ 
	int num;
	char author_name[27];
};

int main()
{
	int ere[26];
	int m,i,max=0,key;
	for(i=0;i<26;i++)
	{
		ere[i]=0;
	}
	char *a;
	struct shu book[999];
	scanf("%d",&m);
	for(i=0;i<m;i++)
	{
		scanf("%d",&book[i].num);
		scanf("%s",book[i].author_name);
	}
	for(i=0;i<m;i++)
	{
		a=book[i].author_name;
		while(*a!='\0')
		{
			ere[(*a)-'A']++;
			a++;
		}
	}
	for(i=0;i<26;i++)
	{
		if(ere[i]>=max)
		{
			max=ere[i];
			key=i;
		}
	}
	printf("%c\n",(key+'A'));
	printf("%d\n",ere[key]);
	for(i=0;i<m;i++)
	{
		a=book[i].author_name;
		while(*a!='\0')
		{
			if((key+'A')==*a)
			{
				printf("%d\n",book[i].num);
				break;
			}
			a++;
		}
	}
	return 0;
}
int main()
{
	char author[27];
	int i,j,n,no,ab[26][1000]={0},an[26]={0},ma=0,na,am;
	cin>>n;
	for(;n>0;n--){
		cin>>no>>author;
		for(i=0;i<27;i++)
			if(author[i]!='\0')ab[author[i]-'A'][an[author[i]-'A']]=no,an[author[i]-'A']++;
			else break;}
	for(i=0;i<26;i++)
	{
		na=0;
		for(j=0;j<999;j++)
			if(ab[i][j]!=0)na++;
			else break;
		if(na>ma)
			ma=na,am=i;
	}
	cout<<(char)('A'+am)<<endl<<ma<<endl;
	for(i=0;i<1000;i++)
		if(ab[am][i]!=0)cout<<ab[am][i]<<endl;
		else break;
	return 0;
}
struct book
{ int n;
  struct book *next;
};
struct au
{
	char n;
	int s;
	struct book *p;
};
void main()
{
	int i,j,k,l,m,n,*p,a[100][1100]={0},max=0,b[100]={0};
	char s[30];
	scanf("%d",&n);
	for(l=1;l<=n;l++)
	{
		scanf("%d",&j);
		scanf("%s",s);
		for(i=0;s[i]!='\0';i++)
		{
			b[s[i]]++;
			a[s[i]][b[s[i]]]=j;
		if(b[s[i]]>b[max]) max=s[i];
		}
	}
	printf("%c\n",(char)max);
	printf("%d\n",b[max]);
	for(i=1;i<=b[max];i++)
		printf("%d\n",a[max][i]);

}
struct book{
       int num;
       char aut[100];
       }b[200000];
int count[1000]={0};

int main()
{
    int n,max=0,maxnum,i,j,f;
    scanf("%d", &n);
    for(i=1;i<=n;i++){
                      scanf("%d %s", &b[i].num, b[i].aut);
                      for(j=0;j<strlen(b[i].aut);j++){count[b[i].aut[j]]++;}
                      }
    for(i='A';i<='Z';i++){
                         if(count[i]>max){
                                          max=count[i];
                                          maxnum=i;
                                          }
                         }
    printf("%c\n%d\n", maxnum, max);
    for(i=1;i<=n;i++){
                      f=0;
                      for(j=0;j<strlen(b[i].aut);j++){
                                                      if(b[i].aut[j]==maxnum){f=1;}
                                                      }
                      if(f==1){printf("%d\n", b[i].num);}
                      }

    return 0;
}
int main()
{
	int m,i,num[26]={0},index1;
	scanf("%d",&m);
	struct f
	{
		int index;
		char writer[27];
	};
	struct f *p;
	p=(struct f *)malloc(m*sizeof(struct f));//???????
	char *p1;
	for(i=0;i<m;i++)
	{
		scanf("%d %s",&(p+i)->index,(p+i)->writer);//????
	}
	for(i=0;i<m;i++)
	{
		p1=(p+i)->writer;
		for(;*p1;p1++)
		{	index1=(int)*p1-'A';//??????????????????
		(*(num+index1))++;}
	}
	int max=0,k;
	for(i=0;i<26;i++)
		if(max<*(num+i)) {max=*(num+i);k=i;}//?????????
		char wr;
		wr=(char)k+'A';
		printf("%c\n%d\n",wr,max);
	int flag;
	for(i=0;i<m;i++)
	{
		p1=(p+i)->writer;
		flag=1;
		for(;*p1&&flag==1;p1++)
			if(*p1==wr) flag=0;
		if(flag==0) printf("%d\n",(p+i)->index);//??????????????????????
	}
}
struct lib
{
	int num;
	char author[26];
}book[1000];
int main()
{
	int n,i,k,p,e;
	e=0;
	int tol[1000]={0};
	int own[1000][1000];
	scanf("%d",&n);
	for(i=0;i<=n-1;i++){
		scanf("%d%s",&(book[i].num),book[i].author);
	}
	for(k='A';k<='Z';k++){
		for(i=0;i<=n-1;i++){
			for(p=0;p<=25;p++){
				if(k==book[i].author[p]){
					tol[k]++;
					own[k][i]=book[i].num;
				}
			}
		}
	}
	for(i='A';i<='Z';i++){
		if(tol[i]>e){
			e=tol[i];
		}
	}
	for(k='A';k<='Z';k++){
		if(tol[k]==e){
			printf("%c\n%d\n",k,tol[k]);
			for(p=0;p<=n-1;p++){
				if(own[k][p]!=0){
					printf("%d\n",own[k][p]);
				}
			}
			break;
		}
	}
	return 0;
}
struct book
{
	int num;
	char a[26];
	struct book *next;
};
void main()
{
	struct book *head,*p,*s;
	head=(struct book *)malloc(sizeof(struct book));
	head->next=NULL;
	int n,i,j,c[26]={0},max,maxj;
	char b[26];
	for(j=0;j<26;j++)
		b[j]=65+j;
	scanf("%d",&n);
	p=head;
	for(i=0;i<n;i++)
	{
		s=(struct book *)malloc(sizeof(struct book));
		scanf("%d %s",&s->num,s->a);
		s->next=NULL;
		p->next=s;
		p=s;
	}
	for(p=head->next;p!=NULL;p=p->next)
	{
		for(i=0;p->a[i]!='\0';i++)
			for(j=0;j<26;j++)
				if(p->a[i]==b[j])
					c[j]++;
	}
//	for(j=0;j<26;j++)
  //      printf("%c %d\n",b[j],c[j]);
	max=c[0];
	maxj=0;
	for(j=1;j<26;j++)
		if(c[j]>max)
		{
			max=c[j];
			maxj=j;
		}
	printf("%c\n",b[maxj]);
	printf("%d\n",c[maxj]);
	for(p=head->next;p!=NULL;p=p->next)
		for(i=0;p->a[i]!='\0';i++)
			if(p->a[i]==b[maxj])
				printf("%d\n",p->num);
}