semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
void main()
{
	struct book
	{
		int num;
		char wri[26];
	}*s;
	int n,i,j,a[100],t;
	char c;
	s=(struct book *)malloc(n*sizeof(struct book));
	
	for(i=0;i<100;i++)
		a[i]=0;
	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d %s",&(*(s+i)).num,(*(s+i)).wri);
	for(i=0;i<n;i++)
	for(j=0;(*(s+i)).wri[j]!='\0';j++)
	{
		for(c='A';c<='Z';c++)
			if(s[i].wri[j]==c) a[s[i].wri[j]]++;
	}
    for(i=0;i<100;i++)
		if(a[0]<a[i]) {a[0]=a[i];t=i;}
	printf("%c\n",t);
         printf("%d\n",a[t]);
	for(i=0;i<n;i++)
		for(j=0;(*(s+i)).wri[j]!='\0';j++)
		{if(s[i].wri[j]==t) printf("%d\n",s[i].num);}
		
}
int main()
{
	int n,max,t,i,j,a[1000],l,b[30]={0},c;
	char str[1000][20];
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d %s",&a[i],str[i]);
		l=strlen(str[i]);
		for(j=0;j<l;j++){
			b[str[i][j]-64]++;
		}
	}
	for(i=1;i<27;i++){
		if(b[i]>max){
			max=b[i];
			t=i;
		}
	}
	printf("%c\n%d\n",t+64,b[t]);
	for(i=0;i<n;i++){
		l=strlen(str[i]);
		for(j=0;j<l;j++){
			if(str[i][j]==t+64)
				printf("%d\n",a[i]);
		}
	}
	return 0;
}
void main()
{
	struct book
	{
		int bianhao;
		char zuozhe[100];
	}a[1000];
	int i,j,n,l,max;
	int b[26]={0};
	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d %s",&a[i].bianhao,a[i].zuozhe);
	for(i=0;i<n;i++)
	  for(j=0;a[i].zuozhe[j]!='\0';j++)
		b[a[i].zuozhe[j]-65]++;
	max=b[0];
	l=0;
	for(i=1;i<=25;i++)
	{
		if(b[i]>max)
		{
			max=b[i];
			l=i;
		}
	}
	printf("%c\n",l+65);
	printf("%d\n",max);
	for(i=0;i<n;i++)
		for(j=0;a[i].zuozhe[j]!='\0';j++)
			if(a[i].zuozhe[j]==(l+65))
			{
				printf("%d\n",a[i].bianhao);
			    break;
			}
}
int main()
{
	int x[26]={0};
	char c;
	struct books
	{
		int number;
		char name[27];
	};
	struct books book[1000];
	int n,i,j,t,max=0;
	struct books *p;
	scanf("%d",&n);
	for(p=book;p<book+n;p++)
		scanf("%d%s",&p->number,p->name);
	for(p=book;p<book+n;p++)
		for(j=0;j<26;j++)
			for(i=65;i<=90;i++)
			    if(p->name[j]==i)
					x[i-65]++;
	for(i=0;i<26;i++)
		if(x[i]>max)
			max=x[i];
	for(i=0;i<26;i++)
		if(x[i]==max)
			break;
	c=i+65;
	printf("%c\n%d\n",c,max);
	for(i=0;i<n;i++)
		for(j=0;j<26;j++)
			if(book[i].name[j]==c)
			{
				printf("%d\n",book[i].number);
				break;
			}

	return 0;
}
struct books
{
	int num;
	char name[100];
	struct books *next;
};
struct books * create(int n)
{
	struct books *head,*p1,*p2;
	p1=(struct books*)malloc(Len);
	scanf("%d %s",&p1->num,p1->name);
	p1->next=NULL;
	head=p1;
	p2=p1;
	while(--n)
	{
		p1=(struct books*)malloc(Len);
		scanf("%d %s",&p1->num,p1->name);
		p1->next=NULL;
		p2->next=p1;
		p2=p1;
	}
	return head;
}
void main()
{
	int n,i,max,k;
    char *p;
	int num[26]={0};
	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'};
	struct books *p1,*head;
	scanf("%d",&n);
    head=create(n);
	p1=head;
	for(i=0;i<26;i++)
	{
		p1=head;
		p=p1->name;
		do
		{

			if(*p==name[i])
			{
				num[i]++;
				p1=p1->next;
				p=p1->name;
			}
			else
			{
				if(*p=='\0')
				{
					p1=p1->next;
					p=p1->name;
				}
				else
				{
					p++;
				}
			}
		}while(p1!=NULL);
	}
	max=num[0];
	for(i=0;i<26;i++)
	{
		if(num[i]>=max)
		{
			k=i;
			max=num[i];//???????num[i]??max??????max????????????25
		}
	}
	printf("%c\n",name[k]);
	printf("%d\n",num[k]);
	p1=head;
	p=p1->name;
	while(p1!=NULL)
	{
		
		if(*p==name[k])
		{
			printf("%d\n",p1->num);
			p1=p1->next;
			p=p1->name;
		}
		else
		{
			if(*p=='\0')
			{
				p1=p1->next;
				p=p1->name;
			}
			else
			{
				p++;
			}
		}
	}
}
void main()
{
	int m,t,b[1000],a[26]={0},max;
	char str[1000][30];
	int i,j;
	scanf("%d",&m);
	for(i=0;i<m;i++)
	{
		scanf("%d %s",&b[i],str[i]);
		for(j=0;str[i][j]!='\0';j++)
		{
			t=str[i][j]-'A';
			a[t]++;
		}
	}
	t=0;
	max=a[0];
	for(i=0;i<26;i++)
	{
		if(max<a[i])
		{
			max=a[i];
			t=i;
		}
	}
	printf("%c\n",'A'+t);
	printf("%d\n",a[t]);
	for(i=0;i<m;i++)
	{
		for(j=0;str[i][j]!='\0';j++)
		{
			if(str[i][j]=='A'+t)
				printf("%d\n",b[i]);
		}
	}
}
int main()
{
	int num[999] , count[27] = {0} , len[999];
	int m , i , j , max = 0 , per;
	cin >> m;
	char ch[999][26] , person;
	for (i = 1 ; i <= m ; i++)
	{
		cin >> num[i] >> ch[i];
		len[i] = strlen (ch[i]);
		for (j = 0 ; j <= len[i] - 1 ; j++)
		{
			count[ch[i][j] - 64]++;
		}
	}
	for (i = 1 ; i <= 26 ; i++)
	{
		if (count[i] > max)
		{
			max = count[i];
			per = i;
		}
	}
	person = per + 64;
	cout << person << endl;
	cout << count[per] << endl;
    for (i = 1 ; i <= m ; i++)
	{
		for (j = 0 ; j <= len[i] - 1 ; j++)
		{
			if (ch[i][j] == person)
			{
				cout << num[i] << endl;
				break;
			}
		}
	}
	return 0;
}
typedef char q[30];
void init(int a[],int f[],q *p[lll],int m)
{
	int i;

char e[432];
char *pp;
int r;
	for(i=1;i<=m;i++)
	{ 
		p[i]=(q *)malloc(sizeof(q));
	
		scanf("%d%s",&f[i],p[i]);
		getchar();
		pp=*p[i];
		while (*pp!='\0')
		{a[*pp]++;
		 pp++;
	    }
     
	}
	
}
char pro(int a[])
{
	char c,max,g;
	max=-333;
	for (c='A';c<='Z';c++) 
		
	if (a[c]>max) {max=a[c];g=c;}
	return g;
}
void print(int f[],q *p[lll],int m,char c)
{
	int i;
		for (i=1;i<=m;i++)
			if (strchr(*p[i],c)!=NULL) printf("%d\n",f[i]);
}
int main()
{
	int m,k;
	int a[343]={0};
		int f[lll];
		q *p[lll];
		char max;
	//freopen("tt.in","r",stdin);
	//freopen("tt.out","w",stdout);
	scanf("%d",&m);
		
	init(a,f,p,m);
	max=pro(a);
	printf("%c\n%d\n",max,a[max]);

	print(f,p,m,max);

}
struct book
{
	int num;
	char name[27];
}book[1000];

int main(int argc, char* argv[])
{
	int m,i,j,a[27],len,max=0,number;
	char p;
	for(i=1;i<=26;i++){
		a[i]=0;
	}
	scanf("%d",&m);
	for(i=1;i<=m;i++){
		scanf("%d %s",&book[i].num,&book[i].name);
		len=strlen(book[i].name);
		for(j=0;j<=len-1;j++){
			p=book[i].name[j];
			a[p-64]+=1;
		}
	}
	for(i=1;i<=26;i++){
		if(a[i]>max){
			max=a[i];
			number=i;
		}
	}
	printf("%c\n%d\n",number+64,a[number]);
	for(i=1;i<=m;i++){
		len=strlen(book[i].name);
		for(j=0;j<=len-1;j++){
			if(book[i].name[j]==number+64){
				printf("%d\n",book[i].num);
			}
		}
	}

	return 0;
}
struct books
{char num[20];
char w[26];};
int main()
{int k,j,i,m;
int b[150]={0};
scanf("%d",&m);
struct books a[1000];
for(i=0;i<m;i++)
{scanf("%s %s",a[i].num,a[i].w);
for(j=0;a[i].w[j]!='\0';j++)
b[a[i].w[j]]++;
   }
int max=0;
for(i='A',j=0;i<='Z';i++)
		if (max<b[i]) {max=b[i];j=i;}
 printf("%c\n",j);
printf("%d\n",max);
int n=0;
for(i=0;i<m;i++)
	{
		n=0;
		for(k=0;a[i].w[k]!='\0';k++)
			if (a[i].w[k]==j)n=1;
			if(n==1) printf("%s\n",a[i].num);

 }
}
char f(int y);

int main()
{
	int m,i,j,number[1000],auther[26],total=0;
	char name[1000][27];
    scanf("%d",&m);
	for(i=0;i<m;i++){
		scanf("%d %s",&number[i],name[i]);
		int n;
		n=strlen(name[i]);
		for(j=0;j<n;j++){
			switch(name[i][j]){
			case'A':auther[0]++;break;
			case'B':auther[1]++;break;
			case'C':auther[2]++;break;	
            case'D':auther[3]++;break;
			case'E':auther[4]++;break;
			case'F':auther[5]++;break;
			case'G':auther[6]++;break;
			case'H':auther[7]++;break;
			case'I':auther[8]++;break;
			case'J':auther[9]++;break;
			case'K':auther[10]++;break;
			case'L':auther[11]++;break;
			case'M':auther[12]++;break;
			case'N':auther[13]++;break;
			case'O':auther[14]++;break;
			case'P':auther[15]++;break;
			case'Q':auther[16]++;break;
			case'R':auther[17]++;break;
			case'S':auther[18]++;break;
			case'T':auther[19]++;break;
			case'U':auther[20]++;break;
			case'V':auther[21]++;break;
			case'W':auther[22]++;break;
			case'X':auther[23]++;break;
			case'Y':auther[24]++;break;
            case'Z':auther[25]++;break;
			}
		}
	}
	int max=auther[0],k,t=0;
	for(k=1;k<26;k++){
		if(auther[k]>max){
			max=auther[k];
		    t=k;
		}
	}
	printf("%c\n",f(t));
	for(i=0;i<m;i++){
        int q;
		q=strlen(name[i]);
		for(j=0;j<q;j++){
			if(name[i][j]==f(t))
				total++;
		}
	}
	printf("%d\n",total);
	for(i=0;i<m;i++){
        int p;
		p=strlen(name[i]);
		for(j=0;j<p;j++){
			if(name[i][j]==f(t))
				printf("%d\n",number[i]);
		}
	}
	return 0;
}
	
	char f(int y){
			char x;
			switch(y){
			case 0:x='A';break;
			case 1:x='B';break;
			case 2:x='C';break;
			case 3:x='D';break;
			case 4:x='E';break;
			case 5:x='F';break;
			case 6:x='G';break;
            case 7:x='H';break;
			case 8:x='I';break;
			case 9:x='J';break;
			case 10:x='K';break;
			case 11:x='L';break;
			case 12:x='M';break;
			case 13:x='N';break;
			case 14:x='O';break;
			case 15:x='P';break;
			case 16:x='Q';break;
			case 17:x='R';break;
            case 18:x='S';break;
			case 19:x='T';break;
			case 20:x='U';break;
			case 21:x='V';break;
			case 22:x='W';break;
			case 23:x='X';break;
			case 24:x='Y';break;
			case 25:x='Z';break;
			}
			return x;
		}
int main()
{
    int n;
    int i, j;
    int book_number[26];
    int max = 0;
    int max_n;
    int author_len;
    
    
    struct data
    {
           int number;
           char author[27];
    };
    
    scanf("%d", &n);
    
    struct data *input = (struct data*) malloc(sizeof(struct data) * n);
    
    
    for(j = 0; j <= 25; j++)
          book_number[j] = 0;
    
    for(i = 0; i <= n - 1; i++)
    {
          scanf("%d %s", &input[i].number, input[i].author);
          author_len = strlen(input[i].author);
          
          for(j = 0; j <= author_len - 1; j++)
                book_number[input[i].author[j] - 'A']++;
       
                
    }
    
    for(j = 0; j <= 25; j++)
    {
          if(book_number[j] > max)
          {
                            max = book_number[j];
                            max_n = j;
          }
    }
    
    printf("%c\n%d\n", max_n + 'A', max);
    
    for(i = 0; i <= n - 1; i++)
    {
          author_len = strlen(input[i].author);
          
          for(j = 0; j <= author_len - 1; j++)
          {
                if(input[i].author[j] == max_n + 'A')
                {
                                      printf("%d\n", input[i].number);
                                      break;
                }
          }
    }
    
    free(input);
     
   
    return 0;
}
void main()
{char c;
int max=0,store,m,i,x[26][1000]={0},coun[27]={0},flag;
scanf("%d", &m);
for (i=1;i<=m;i++)
	{scanf("%d ", &store);
     for (;;)
		 {scanf("%c", &c);
	      if (c<65||c>90)
			  break;
		  else {x[c-64][i]=store;coun[c-64]++;}}
    }
for (i=1;i<=26;i++)
   {if (coun[i]>max)
     {max=coun[i];
      flag=i+64;
     }
   }
printf("%c\n", flag);
printf("%d\n", coun[flag-64]);
for (i=1;i<=1000;i++)
	{if (x[flag-64][i]!=0)
	 printf("%d\n", x[flag-64][i]);
    }

}
int main(int argc, char* argv[])
{
	int m,i,j=0,zhe[26],t=0,x,name;
	for(i=0;i<26;i++)
	{
		zhe[i]=0;
	}
	char s[26];
	scanf("%d",&m);
	struct
	{
		int num;
		char s[26];
	}shu[1000];
	for(i=0;i<m;i++)
	{
		scanf("%d%s",&shu[i].num,shu[i].s);
	}
for(i=0;i<m;i++)
{
    for(j=0;shu[i].s[j]!=0;j++)
	{
    	switch(shu[i].s[j])
		{
        	case 'A':zhe[0]++;break;
            case 'B':zhe[1]++;break;
        	case 'C':zhe[2]++;break;
	        case 'D':zhe[3]++;break;
	case 'E':zhe[4]++;break;
	case 'F':zhe[5]++;break;
	case 'G':zhe[6]++;break;
	case 'H':zhe[7]++;break;
	case 'I':zhe[8]++;break;
	case 'J':zhe[9]++;break;
	case 'K':zhe[10]++;break;
	case 'L':zhe[11]++;break;
	case 'M':zhe[12]++;break;
	case 'N':zhe[13]++;break;
	case 'O':zhe[14]++;break;
	case 'P':zhe[15]++;break;
	case 'Q':zhe[16]++;break;
	case 'R':zhe[17]++;break;
	case 'S':zhe[18]++;break;
	case 'T':zhe[19]++;break;
	case 'U':zhe[20]++;break;
	case 'V':zhe[21]++;break;
	case 'W':zhe[22]++;break;
	case 'X':zhe[23]++;break;
	case 'Y':zhe[24]++;break;
	case 'Z':zhe[25]++;break;
		}
	}
	}
	    for(j=0;j<26;j++)
		{
			if(zhe[j]>t)
			{
				t=zhe[j];
			    x=j;
			}
		}
			name='A'+x;
			printf("%c\n",name);
		printf("%d\n",t);
		for(i=0;i<m;i++)
		{
			for(j=0;j<26;j++)
			{
			if(shu[i].s[j]==name)
				printf("%d\n",shu[i].num);
			}
		}


	return 0;
}
struct information
{
	int a;
	char s[26];
	int len;
}xinxi[1000];


void main()
{
	int n,i,c[26]={0},max,t,j;

	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d %s",&xinxi[i].a,xinxi[i].s);
        xinxi[i].len=strlen(xinxi[i].s) ;
	}
	for(i=0;i<n;i++)
      for(j=0;j<xinxi[i].len;j++)
	  {
		  if(xinxi[i].s[j]=='A')  c[1]++;
		  if(xinxi[i].s[j]=='B')  c[2]++;
		  if(xinxi[i].s[j]=='C')  c[3]++;
		  if(xinxi[i].s[j]=='D')  c[4]++;
		  if(xinxi[i].s[j]=='E')  c[5]++;
		  if(xinxi[i].s[j]=='F')  c[6]++;
		  if(xinxi[i].s[j]=='G')  c[7]++;
		  if(xinxi[i].s[j]=='H')  c[8]++;
		  if(xinxi[i].s[j]=='I')  c[9]++;
		  if(xinxi[i].s[j]=='J')  c[10]++;
		  if(xinxi[i].s[j]=='K')  c[11]++;
		  if(xinxi[i].s[j]=='L')  c[12]++;
		  if(xinxi[i].s[j]=='M')  c[13]++;
		  if(xinxi[i].s[j]=='N')  c[14]++;
		  if(xinxi[i].s[j]=='O')  c[15]++;
		  if(xinxi[i].s[j]=='P')  c[16]++;
		  if(xinxi[i].s[j]=='Q')  c[17]++;
		  if(xinxi[i].s[j]=='R')  c[18]++;
		  if(xinxi[i].s[j]=='S')  c[19]++;
		  if(xinxi[i].s[j]=='T')  c[20]++;
		  if(xinxi[i].s[j]=='U')  c[21]++;
		  if(xinxi[i].s[j]=='V')  c[22]++;
		  if(xinxi[i].s[j]=='W')  c[23]++;
		  if(xinxi[i].s[j]=='X')  c[24]++;
		  if(xinxi[i].s[j]=='Y')  c[25]++;
		  if(xinxi[i].s[j]=='Z')  c[26]++;
	  }
	  max=c[0];
	  t=0;
    for(i=1;i<26;i++)
	{
		if(c[i]>max)
		{
			max=c[i];
			t=i;
		}
	}
	printf("%c\n",64+t);
	printf("%d\n",c[t]);
	for(i=0;i<n;i++)
		for(j=0;j<xinxi[i].len;j++)
			if(xinxi[i].s[j]==64+t)
				printf("%d\n",xinxi[i].a);
}
int main()
{
	char mname[999][26], name;
	int i, j, m, len, max = 0;
	int num[999], count[26] = {0};
	cin >> m;
	for (i = 0; i < m; i++)
	{
		cin >> num[i] >> mname[i];
		len = strlen(mname[i]);
		for (j = 0; j < len; j++)
		{
			count[mname[i][j] - 'A']++;
		}
	}
	for (i = 0; i < 26; i++)
	{
		if (count[i] > max)
		{
			max = count[i];
			name = i + 'A';
		}
	}
	cout << name << endl << max << endl;
	for (i = 0; i < m; i++)
	{
		len = strlen(mname[i]);
		for (j = 0; j < len; j++)
		{
			if (mname[i][j] == name)
			{
				cout << num[i] << endl;
				break;
			}
		}
	}
	return 0;
}
int main()
{
	int number[1001],num[27]={0},ascii[27];
	char a[1001][27],p;
	int i,j,m,n,t1,t;
	cin>>m;
	n=26;
	for(i=0;i<m;i++)
	{
		cin>>number[i];
		cin>>a[i];
		for(j=0;j<strlen(a[i]);j++)
		{
			num[a[i][j]-'A']++;
		}
	}
	for(i=0;i<n;i++)
	{
		ascii[i]=i;
	}
	for(i=0;i<n;i++)
	{
		for(j=n-1;j>0;j--)
		{
			if(num[j]>num[j-1])
			{
				t=num[j];
				num[j]=num[j-1];
				num[j-1]=t;
				t1=ascii[j];
				ascii[j]=ascii[j-1];
				ascii[j-1]=t1;
			}
		}
	}
	p='A'+ascii[0];
	cout<<p<<endl;
	cout<<num[0]<<endl;
	for(i=0;i<m;i++)
	{
		for(j=0;j<strlen(a[i]);j++)
		{
			if(a[i][j]==p)
			{
				cout<<number[i]<<endl;
				break;
			}
		}
	}
	return 0;
}
struct book
{
int number;
char a[26];
int la;
struct book *next;
};

struct book *insert(struct book *head,struct book *temp)
{
struct book *p0,*p1,*p2;
p1=head;
p0=temp;
if(head==NULL)
 {head=p0;p0->next=NULL;}
else
 {
 while(p1->next!=NULL)
 {p1=p1->next;}
 p1->next=p0;
 p0->next=NULL;
 }
return head;
}



void main()
{
struct book *p,*temp,*head=NULL;
int i,m,max;
int b[26]={0};
char writer;
scanf("%d",&m);
for(i=0;i<m;i++)
{
temp=(struct book *)malloc(sizeof(struct book));
scanf("%d ",&temp->number);
gets(temp->a);

temp->la=strlen(temp->a);
temp->next=NULL;
head=insert(head,temp);
}

p=head;
while(p!=NULL)
{
for(i=0;i<p->la;i++)
b[p->a[i]-65]++;
p=p->next;

}
max=b[0];writer=65;
for(i=0;i<26;i++)
{
 if(b[i]>max) 
 {
  max=b[i];
  writer=i+65;
 }
}

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

p=head;
while(p!=NULL)
{
for(i=0;i<p->la;i++)
if(p->a[i]==writer)
{printf("%d\n",p->number);break;}
p=p->next;
}



}
int main()
{ struct s
  {int N;
   char w[26];
   };
  struct s s[999];
  int n,i,j,c,a[26];
  scanf("%d\n",&n);
  for (i=0;i<=(n-1);i++)
   { scanf("%d",&s[i].N);
     gets(s[i].w);
    }
  for (i=0;i<=(n-1);i++)
     { for (j=0;j<=25;j++)
         {  c=s[i].w[j];
            a[c-65]++;
          } 
      }
  c=0;
  for (i=0;i<=25;i++)
    { if (a[c]<a[i]) c=i; 
     }
  printf("%c\n%d\n",c+65,a[c]);
  for (i=0;i<=(n-1);i++)
    { for (j=0;j<=25;j++)
        if (s[i].w[j]==(c+65)) printf("%d\n",s[i].N);
     }
}
struct book
{
	int num;
	char zz[32];
    struct book *next;
};
struct book *creat(int n)
{
	struct book *head,*p1,*p2;
	int i;
	p1=p2=(struct book *)malloc(LEN);
	scanf("%d %s",&p1->num,p1->zz);
	head=NULL;
	for(i=0;i<n-1;i++)
	{
		if(i==0) head=p1;
		else p2->next=p1;
		p2=p1;
		p1=(struct book *)malloc(LEN);
		scanf("%d %s",&p1->num,p1->zz);
	}
	p2->next=p1;
	p1->next=NULL;
	return (head);
}
void search(struct book *head,int n)
{
	int *p[26],i,j;
	struct book *q=head;
	for(i=0;i<26;i++)
	{
		p[i]=(int *)malloc(sizeof(int));
		*p[i]=0;
	}
    for(i=0;i<n;i++)
	{
		for(j=0;(q->zz)[j]!='\0';j++)
		{
			(*p[(q->zz)[j]-'A'])++;
		}
		q=q->next;
	}
	q=head;
	int max=*p[0],k=0;
	for(i=1;i<26;i++)
	{if(*p[i]>max){max=*p[i];k=i;}}
	printf("%c\n%d",'A'+k,max);
	for(i=0;i<n;i++)
	{
		for(j=0;(q->zz)[j]!='\0';j++)
		{
			if((q->zz)[j]=='A'+k)
				printf("\n%d",q->num);
		}
		q=q->next;
	}
}



void main()
{
	int n;
	scanf("%d",&n);
	struct book *head;
	head=creat(n);
	search(head,n);
}
int main()  
{char ma='A';
int cnt[128]={0};
int i,j,n;
struct s
{int id;
char au[27];
}bk[1000];

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]!='\0';j++)
{cnt[bk[i].au[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 cs
{
	int b;
	char a[26];
};
int main()
{
	int m,i,j,k,max=0;
	int c[200][1000],count[200]={0};
	struct cs x[1000];
	scanf("%d",&m);
	for(i=0;i<m;i++)
	{
		scanf("%d",&x[i].b);
		gets(x[i].a);
	}
	for(i=0;i<m;i++)
	{
		for(j=0;j<strlen(x[i].a);j++)
		{
			for(k=65;k<91;k++)
			{
				if(x[i].a[j]==k)
				{count[k]++;
				c[k][count[k]]=x[i].b;
				}
			}
		}
	}
	for(k=65;k<91;k++)
	{
		if(count[k]>max)
			max=count[k];
	}
	for(k=65;k<91;k++)
	{
		if(count[k]==max)
		{
			printf("%c\n%d\n",k,count[k]);
			for(j=1;j<=max;j++)
			{
				printf("%d\n",c[k][j]);
			}
		}
	}
	return 0;
}
int main()
{
    int n,i,j,max=0;
    int zuozhe[26]={0};
    char maxer;
    struct book
    {
         int num;
         char author[26];
    }
    shu[1000];
    scanf("%d",&n);
    for (i=0;i<n;i++)
    {
        scanf("%d %s",&shu[i].num,shu[i].author);
        for (j=0;j<26;j++)
           zuozhe[shu[i].author[j]-65]++;
    }
    for (j=0;j<26;j++)
        if (zuozhe[j]>max)
        {
            max=zuozhe[j];
            maxer=j+65;
        }
    printf("%c\n%d\n",maxer,max);
    for (i=0;i<n;i++)
        for (j=0;j<26;j++)
            if (shu[i].author[j]==maxer)
            {
                printf("%d\n",shu[i].num);
                continue;
            }
}
struct book{
		int num;
		char aut[20];
	};
	
void main()
{
	int i,j,n,t,max=0;
	char a[20];
	int words[26]={0};
	struct book b[100];
	scanf("%d",&n);

	for(i=0;i<n;i++)
	scanf("%d%s",&(b[i].num),&(b[i].aut));
		
	for(i=0;i<n;i++)
	for(j=0;b[i].aut[j]!='\0';j++){
		t=(int)b[i].aut[j]-65;
		words[t]++;
	}
	
	for(i=0;i<26;i++)
	if(words[i]>max)  { max=words[i];t=i;}
	printf("%c\n%d\n",t+65,max);
	
	for(i=0;i<n;i++)
	for(j=0;b[i].aut[j]!='\0';j++)
		if(b[i].aut[j]==(char)(t+65))
		printf("%d\n",b[i].num);
}
struct zuozhe
        {
                int m;
                char q;
                char shu[1001][5];
        }zuozhe[26],t;
int main()
{
        int n;
        cin>>n;
        int i;
        char xingming[30];
        char bianhao[5];
        char zimu[27]="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
        for(i=0;i<26;i++)
                zuozhe[i].m=0;
        for(i=1;i<=n;i++)
        {
                cin>>bianhao>>xingming;
                int j,k;
                for(j=0;xingming[j]!='\0';j++)
                {
                        for(k=0;k<26;k++)
                        {
                                if(xingming[j]==zimu[k])
                                {
                                        zuozhe[k].m++;
                                        zuozhe[k].q=zimu[k];
                                        strcpy(zuozhe[k].shu[zuozhe[k].m],bianhao);
                                        break;
                                }
                        }
                }
        }
        int min=0;
        int maxnum = 0;
        for(i=0;i<26;i++)
        {
                
                        if(zuozhe[i].m>maxnum)
                        {
                                maxnum = zuozhe[i].m;
                                min = i;
                        }
        }
        cout<<zuozhe[min].q<<endl<<zuozhe[min].m<<endl;
        for(i=1;i<=zuozhe[min].m;i++)
        {
                cout<<zuozhe[min].shu[i]<<endl;
        }
        return 0;
}
struct information
{
	int num;
	char author[26];
}*a;
void main()
{
	int n,i,j,m,s[26]={0},max=0,p;
	scanf("%d",&n);
	a=(struct information *)malloc(sizeof(struct information)*n);
	for(i=0;i<n;i++) scanf("%d%s",&a[i].num,a[i].author);
	for(i=0;i<n;i++)
	{
		for(j=0;a[i].author[j]!='\0';j++)
		{
			m=a[i].author[j]-'A';s[m]++;
		}
	}
	for(i=0;i<26;i++)
	{
		if(max<s[i]) {max=s[i];p=i;}
	}
	printf("%c\n%d\n",'A'+p,s[p]);
	for(i=0;i<n;i++)
	{
		for(j=0;j<26;j++)
		{
			if(a[i].author[j]=='A'+p) {printf("%d\n",a[i].num);break;}
		}
	}
}
struct book
{
       char number[20];
       char name[26];
}books[1000];

main() 
{
       int n,i,j;int count[26]={0};int temp,base,k=0;char author;int pd=0,N=0;
       scanf("%d",&n);
       for(i=0;i<n;i++)
       {
                       scanf("%s %s",&books[i].number,&books[i].name);
       }
       for(i=0;i<n;i++)
       {               
                       for(j=0;books[i].name[j]>='A'&&books[i].name[j]<='Z';j++)
                       {
                                 temp=books[i].name[j]-'A';
                                 count[temp]++;
                       }
       }
       base=count[0];
       for(i=0;i<26;i++)
       {
                        if(count[i]>base)
                        {base=count[i];k=i;}
       }
       author='A'+k;
       printf("%c\n",author);
        for(i=0;i<n;i++)
       {               pd=0;
                       for(j=0;books[i].name[j]>='A'&&books[i].name[j]<='Z';j++)
                       {
                             
                              if(books[i].name[j]==author)
                              pd=1;
                       }
                       if(pd==1)
                       N++;
       }
       printf("%d\n",N);
       for(i=0;i<n;i++)
       {               pd=0;
                       for(j=0;books[i].name[j]>='A'&&books[i].name[j]<='Z';j++)
                       {
                             
                              if(books[i].name[j]==author)
                              pd=1;
                       }
                       if(pd==1)
                       printf("%s\n",books[i].number);
       }
                                    
      
}
int main()
{
	int n,i,j;
	scanf("%d",&n);
	struct book{
		short int a;
		char s[27];
	}b[999];
	short int q[26]={0};
	short int w[26]={0},p,t,m;
	for(i=0;i<n;i++)
	{
		scanf("%d %s",&b[i].a,b[i].s);
	}
	for(i=0;i<n;i++)
			for(j=0;b[i].s[j]!='\0';j++)
		{
			p=(int)b[i].s[j]-65;
			q[p]++;
			w[p]++;
		}
	
	for(i=0;i<25;i++)
		for(j=0;j<25-i;j++)
			if(q[j]<q[j+1])
		{
			t=q[j];
			q[j]=q[j+1];
			q[j+1]=t;
		}
		for(i=0;i<25;i++)
			
			if(w[i]==q[0])
				m=i;
			printf("%c\n",(char)(m+65));
			printf("%d\n",w[m]);
				for(i=0;i<n;i++)
				   for(j=0;b[i].s[j]!='\0';j++)
					   if(b[i].s[j]==m+65)
						   printf("%d\n",b[i].a);
					   return 0;
}
void main()
{
	int i,n,j,t,m,a[26]={0},book[999],max;
    char writer[999][26],maxwriter;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d %s",&book[i],writer[i]);
		m=strlen(writer[i]);
		for(j=0;j<m;j++)
		{
			t=writer[i][j]-'A';
			a[t]++;
		}
	}
	max=0;
	maxwriter='A';
	for(i=0;i<26;i++)
	{
		if(a[i]>max)
		{
			max=a[i];
			maxwriter='A'+i;
		}
	}
	printf("%c\n%d\n",maxwriter,max);
	for(i=0;i<n;i++)
	{
		for(j=0;j<strlen(writer[i]);j++)
		{
			if(writer[i][j]==maxwriter)
			{
				printf("%d\n",book[i]);
				break;
			}
		}
	}
}