semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
struct aut
{
	char name;
	int num;
	int id[1000];
};

struct aut author[26];

int main()
{
	int m,i,j,ID,max=0,maxauthor,k[26]={0};
	char c[27];
	scanf("%d",&m);
	for(i=0;i<26;i++){
		author[i].name='A'+i;
		author[i].num=0;
	}
	for(i=0;i<m;i++){
		scanf("%d %s",&ID,c);
		for(j=0;c[j];j++){
			author[c[j]-'A'].id[k[c[j]-'A']]=ID;
			k[c[j]-'A']++;
			author[c[j]-'A'].num++;
		}
	}
	for(i=0;i<26;i++){
		if(author[i].num>max){
			max=author[i].num;
			maxauthor=i;
		}
	}
	printf("%c\n%d\n",author[maxauthor].name,author[maxauthor].num);
	for(i=0;i<author[maxauthor].num;i++){
		printf("%d\n",author[maxauthor].id[i]);
	}
	
	return 0;
}
struct book
{
	int num;
	char name[20];
};
void main()
{
	struct book c[1000];
	int i,j,n,k,max,l,d[26],a;
	int b[26]={0};
	scanf("%d",&n);
	for(k=0;k<n;k++)
	{
	scanf("%d %s",&c[k].num,c[k].name);
	for(i=0;i<strlen(c[k].name);i++)
	{
		for(j=0;j<26;j++)
		{
			if('A'+j==c[k].name[i])
				break;
        }
		b[j]=b[j]+1;
	}
	}
	for(a=0;a<26;a++)
		d[a]=b[a];
     max=b[0];
	 for(l=0;l<26;l++)
	 if(b[l]>max)
		 max=b[l];
	  for(a=0;a<26;a++)
	{
		if(d[a]==max)
			break;
	}
	printf("%c\n",'A'+a);
	 printf("%d\n",max);
	
	 for(k=0;k<n;k++)
	 {
        for(i=0;i<strlen(c[k].name);i++)
	{
			if('A'+a==c[k].name[i])
			{
	            printf("%d\n",c[k].num);
				break;
			}
	}
	 }
}
int alpha[26]={0};
struct library
{
	int num;
	char authors[27];
}books[999];
void addauthor(char string[])
{
	int i=0;
	do
	{ alpha[string[i]-'A']++;
	i++;
	}
	while(string[i]!='\0');
}
void hewroteit(struct library book,int maxalpha)
{
	int i;
	for(i=0;book.authors[i]!='\0';i++)
	{
		if(book.authors[i]-'A'==maxalpha)
		{
			printf("%d\n",book.num);
			break;
		}
	}
}
int main()
{
	int m;
	scanf("%d",&m);
	int i;
	for(i=0;i<m;i++)
		scanf("%d %s",&books[i].num,books[i].authors);
	for(i=0;i<m;i++)
		addauthor(books[i].authors);
	int max=0,maxalpha=0;
	for(i=0;i<26;i++)
	{
		if (alpha[i]>max)
		{
			max=alpha[i];
			maxalpha=i;
		}
	}
	printf("%c\n%d\n",'A'+maxalpha,max);
	for(i=0;i<m;i++)
	{
		hewroteit(books[i],maxalpha);
	}
	return 0;
}
int  num[1000];
char auth[1000][26];

int main()
{
	int m,i,l;
	scanf("%d",&m);
	char c='A';
	int k=0;
	int a[26];
	for(i=0;i<26;i++)
		a[i]=0;
	for (i=0;i<m;i++)
	{
		scanf("%d",&num[i]);
		scanf("%s",auth[i]);
		int j=0;
		while(auth[i][j]!='\0')
		{
			a[auth[i][j]-64]++;
			j++;
		}
	}
	for(i=0;i<25;i++)
	{
		if (a[i]>k)
		{
			k=a[i];
			c=i+64;
		}
	}
	printf("%c\n%d\n",c,k);

	for(i=0;i<m;i++)
		for(l=0;l<26;l++)
		{
			if(auth[i][l]==c)
				printf("%d\n",num[i]);
		}
	return 0;
}
void main()
{
	int s=0,n,i,j,b[26]={0},t,x,m,q;
    char a[1000][27];
	scanf("%d\n",&n);
	for(i=0;i<n;i++)
	{
		gets(a[i]);
	}
	for(i=0;i<n;i++)
	{  
		t=strlen(a[i]);
		for(j=4;j<t;j++)
		{
			x=a[i][j];
			b[x-65]=b[x-65]+1;
		}
	}
	for(i=0;i<26;i++)
	{
		if(b[i]>s)
		{s=b[i];x=i;}
	}
	printf("%c\n",x+65);
	printf("%d\n",s);
	for(i=0;i<n;i++)
	{
		t=strlen(a[i]);
		for(j=4;j<t;j++)
		{
			m=a[i][j];
			if(m==x+65)
			{ 
				for(q=0;q<2;q++)
				{printf("%c",a[i][q]);}
			    printf("%c\n",a[i][2]);
			}
		}
	}




	
}
main()
{
	int n,i,a,t,d[26]={0},f=0,c,h,e=0;
	struct book
	{
		int N;
		char name[20];
	}p[1000];
	scanf("%d",&n);
	for(i=0;i<=n-1;i++)
		scanf("%d %s",&p[i].N,p[i].name);
	for(i=0;i<=n-1;i++)
	{
        a=strlen(p[i].name);
        for(t=0;t<=a-1;t++)
		{
		    c=p[i].name[t]-'A';
			d[c]++;
		}
	}
	for(i=0;i<=25;i++)
	{
	    if (e<d[i])
		{
		    e=d[i];
			f=i;
		}
	}
	h=f+'A';
	printf("%c\n%d\n",h,e);
	for(i=0;i<=n-1;i++)
	{
        a=strlen(p[i].name);
        for(t=0;t<=a-1;t++)
		{
        	if(p[i].name[t]==h)
			{
			printf("%d\n",p[i].N);
			break;
			}
		}
	}
}
struct student{
	char name[27];
	int anum;
	int num;
	struct student *next;
};
int n;
int i;
char c;

struct student *creat()
{
	struct student *head;
	head=(struct student *)malloc(LEN);
	if(n==0)
		head=NULL;
	else
	{
		scanf("%d",&head->num);
		for(i=0;(c=getchar())!='\n';i++)
		{
			head->name[i]=c;
		}
		head->anum=i;		
		head->next=NULL;
	}
	return(head);
}


int main()
{
	struct student *head,*p1,*p2,*p;
	char l[200]={0};
	int j;
	int max=0;
	int lmax;


	scanf("%d",&n);
	head=creat();
	p1=p2=head;

	for(i=1;i<n;i++)
	{
		{
			p1=(struct student *)malloc(LEN);
			p2->next=p1;
			p2=p1;

			scanf("%d",&p2->num);
			for(j=0;(c=getchar())!='\n';j++)
			{
				p2->name[j]=c;
			}
			p2->anum=j;

			p2->next=NULL;
		}
	}

	p=head;
	for(j=0;j<n;j++)
	{
		for(i=0;i<p->anum;i++)
		{
			l[p->name[i]]=l[p->name[i]]+1;
		}
		p=p->next;
	}



	for(i=65;i<=90;i++)
	{
		if(l[i]>max)
		{
			max=l[i];
			lmax=i;
		}

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

	p=head;
	for(j=0;j<n;j++)
	{
		for(i=0;i<p->anum;i++)
		{
			if(p->name[i]==lmax)
				printf("%d\n",p->num);
		}
		p=p->next;
	}


	return 0;
}
int main()
{
	int booknumber;
	int order[1000];
	char author[1000][27];
	char single_author[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 author_booknumber[26]={0};
	int i,j,k;
	int tmp;


	scanf("%d",&booknumber);

	for(i=0;i<booknumber;i++)
	{
		scanf("%d%s",&order[i],author[i]);
		for(j=0;j<strlen(author[i]);j++)
		{
			for(k=0;k<26;k++)
			{
				if(author[i][j]==single_author[k])
				{
					author_booknumber[k]++;
					break;
				}
			}
		}
	}
	tmp=0;

	for(i=1;i<26;i++)
	{
		if(author_booknumber[i]>author_booknumber[tmp])
			tmp=i;
	}
	printf("%c\n",single_author[tmp]);
	printf("%d\n",author_booknumber[tmp]);
   
	for(i=0;i<booknumber;i++)
	{
		for(j=0;j<strlen(author[i]);j++)
		{
			if(author[i][j]==single_author[tmp])
			{
				printf("%d\n",order[i]);
				break;
			}
		}
	}


	return 0;
}
int main(){
    struct book {
           char z[27];
           int no;
           };
           
           struct book a[1000];
           
    int m, i, x, p, j  ; 
    scanf("%d", &m);
    
    for (i=0; i<m; i++){
        scanf("%d%s", &a[i].no, a[i].z);
        } 
    
    int memo[26]={0};
    
    for (i=0; i<m; i++){
        for (j=0; j<26; j++){
            if (a[i].z[j]=='\0')
            break;
            x=(a[i].z[j])-65;
            memo[x]++;
            }
        } 
        x=0;
        p=0;
    for (i=0; i<26; i++){
       
        if (memo[i]>x){x=memo[i];
                       p=i;
                       }
        }
     
     printf("%c\n", p+65); 
      
     int n=0;
        
     for (i=0; i<m; i++){
        for (j=0; j<26; j++){
            if (a[i].z[j]=='\0')
            break;
            if (a[i].z[j]==p+65)
            n++;  
            }
        } 
        
     printf("%d\n", n);
     
     for (i=0; i<m; i++){
        for (j=0; j<26; j++){
            if (a[i].z[j]=='\0')
            break;
            if (a[i].z[j]==p+65){
            printf("%d\n", a[i].no);
            break;}  
            }
        } 
        
        
    return 0;    
    
    }
int main()
{
struct book
{
    int No;
    char name[27];
}b[1000];
    int i,j,m;
    scanf("%d",&m);
    printf("\n");
    for(i=0;i<m;i++){
        scanf("%d ",&b[i].No);
        scanf("%s",b[i].name);
    }
    int n,l,a[26]={0};
    for(i=0;i<m;i++){
        l=strlen(b[i].name);             
        for(j=0;j<l;j++){
            n=b[i].name[j];a[n-65]++;             
        }             
    }
    int max=0,x;
    for(i=0;i<26;i++){
        if(a[i]>max){max=a[i];x=i;}              
    }
    printf("%c\n%d",x+65,max);
    for(i=0;i<m;i++){
        l=strlen(b[i].name);             
        for(j=0;j<l;j++){
            if(b[i].name[j]==x+65){printf("\n%d",b[i].No);break;}                          
        } 
    }                
    return 0;
}
struct person{
    int num;
    int book[1000];
};
struct person p[26];
int n,m,i,j,k;
char str[30];
int main(){
    memset(p,0,sizeof(p));
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%d%s",&m,str);
        for(j=strlen(str)-1;j>=0;j--)
            if(str[j]>='A'&&str[j]<='Z'){
                k=p[str[j]-'A'].num++;
                p[str[j]-'A'].book[k]=m;
            }
    }
    m=0;
    for(i=1;i<26;i++)
        if(p[i].num>p[m].num)
            m=i;
    printf("%c\n",'A'+m);
    printf("%d\n",p[m].num);
    for(i=0;i<p[m].num;i++)
        printf("%d\n",p[m].book[i]);
    return 0;
}
void main()
{
	int *p;
	p=(int *)malloc(26*sizeof(int));
	struct book
	{
     int num;
     char s[26];
	}b[999];
	int n,i,j,ss,max=0,r;
	char x;
    for(ss=0;ss<26;ss++)
    *(p+ss)=0;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d %s",&b[i].num,b[i].s);
	 for(j=0;b[i].s[j]!='\0';j++)
	 {
      *(p+((int)b[i].s[j]-65))+=1;
	 }
	}
	for(r=0;r<26;r++)
		max=max>*(p+r)?max:*(p+r);
	

    for(r=0;r<26;r++)
	{
		if(*(p+r)==max)
		{printf("%c",(65+r));
        x=r;
		printf("\n");
		printf("%d\n",max);}
	}
   for(i=0;i<n;i++)
   {
	for(j=0;b[i].s[j]!='\0';j++)
	{
	if((int)b[i].s[j]-65==x)
	printf("%d\n",b[i].num);
	}
	} 
}
int main(int argc, char* argv[])
{
	struct book{
		int num;
		char author[27];
	}B[1000];
	char A;
	int m,i,j,a[26]={0},max;
	scanf("%d",&m);
	for(i=0;i<m;i++){
		scanf("%d%s",&B[i].num,B[i].author);
	}
	for(i=0;i<m;i++){
		for(j=0;;j++){
			if(B[i].author[j]==0)
				break;
			else
				a[B[i].author[j]-65]++;
		}
	}
	max=a[0];
	A=65;
	for(i=0;i<26;i++){
		if(a[i]>max){
			max=a[i];
			A=i+65;
		}
	}
	printf("%c\n%d",A,max);
	for(i=0;i<m;i++){
		for(j=0;;j++){
			if(B[i].author[j]==0)
				break;
			if(B[i].author[j]==A)
				printf("\n%d",B[i].num);
		}
	}
	return 0;
}
struct book
{
    char writer[32];
    int id;
    struct book *next;
};
struct book *create(int m)
{
     struct book *head=NULL,*p1,*p2;
     int i;
     p1=p2=(struct book*)malloc(Len);
     scanf("%d %s",&p1->id,p1->writer);
     p1->next=NULL;
     head=p1;
     p2=p1;
     for(i=1;i<m;i++)
        {
            p1=(struct book*)malloc(Len);
             scanf("%d %s",&p1->id,p1->writer);
            p1->next=NULL;
            p2->next=p1;
            p2=p1;
        }
         return head;
}
int main()
{
    struct book *head,*p;
    int m,i,*q1,*q2,j;
    q1=(int*)malloc(26*sizeof(int*));
      q2=q1;
    for(i=0;i<26;i++)
      q1[i]=0;
    q1=q2;
    scanf("%d",&m);
    head=create(m);
    p=head;
    for(i=0;i<m;i++)
    {
       for(j=0;p->writer[j]!='\0';j++)
       q1[p->writer[j]-'A']++;
       p=p->next;
    }
    q1=q2;
    int max=0;
    char maxm='A';
    for(i=0;i<26;i++)
      if(max<q1[i]) {max=q1[i];maxm=i+'A';}
      printf("%c\n%d",maxm,max);
    for(i=0,p=head;i<m;i++,p=p->next)
      for( j=0;p->writer[j]!='\0';j++)
        if(p->writer[j]==maxm) printf("\n%d",p->id);
}
struct books
{
	int num;
	char author[27];
}book[999];
void main()
{
    int f(struct books *p,int n,char z);
	int i,n,j,x[26],k,max;
	char z;
	scanf("%d",&n);
	for(i=0;i<n;i++)scanf("%d%s",&book[i].num,book[i].author);
	for(z='A',i=0;z<='Z';z++,i++)x[i]=f(book,n,z);
	for(i=1,max=x[0],k=0;i<26;i++)if(x[i]>max){max=x[i];k=i;}
    printf("%c\n%d\n",k+65,max);
	for(i=0;i<n;i++)for(j=0;book[i].author[j]!='\0';j++)
		if(book[i].author[j]==k+65){printf("%d\n",book[i].num);break;}
}
int f(struct books *p,int n,char z)
{
	int m=0,i,j;
	for(i=0;i<n;i++)for(j=0;(p+i)->author[j]!='\0';j++)
		if((p+i)->author[j]==z){m++;break;}
	return m;
}
struct book
{int num;
char w[26];
}b[999];
void main()
{  
	int m,i,j,k,e;
	scanf("%d",&m);
	for(i=0;i<m;i++)
		scanf("%d %s",&b[i].num,b[i].w);
	char a[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 c[26]={0};
	for(j=0;j<26;j++)
    {for(i=0;i<m;i++)
	{e=strlen(b[i].w);
	for(k=0;k<e;k++)
		if(b[i].w[k]==a[j])
			c[j]++;
	}
	}
	int sum=0;
	for(j=0;j<26;j++)
		if(c[j]>c[sum])
			sum=j;
		printf("%c\n",a[sum]);
		printf("%d\n",c[sum]);
	for(i=0;i<m;i++)
	{e=strlen(b[i].w);
	for(k=0;k<e;k++)
		if(b[i].w[k]==a[sum])
	printf("%d\n",b[i].num);
	}
}
struct 
{int no;
 char wri[27];
} book[1000];

void main()
{
	int n,i,j,k=0,a[26]={0};
	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d %s",&book[i].no,book[i].wri);
	for(i=0;i<n;i++)
		for(j=0;book[i].wri[j]!='\0';j++)
			a[book[i].wri[j]-'A']++;
	for(i=0;i<26;i++)
		if(a[i]>a[0]){a[0]=a[i];k=i;}
	printf("%c\n%d\n",'A'+k,a[0]);
	for(i=0;i<n;i++)
		for(j=0;book[i].wri[j]!='\0';j++)
			if(book[i].wri[j]=='A'+k){printf("%d\n",book[i].no);break;}
}
struct book
{
	int num;
	char writer[20];
	struct book *next;
};
int main()
{
	int n,i,j,m,k,c[26],max;//c[26]???????????//
	char a[26];//a[26]??????//
	scanf("%d",&m);
	struct book *p1,*p2,*head;
	for(i=0;i<m;i++)
	{
		p1=(struct book*)malloc(Len);
		if(i==0)
		{
			head=p1;
		}
		else
		{
			p2->next=p1;
		}
		p2=p1;
		scanf("%d %s",&p1->num,p1->writer);
	}
	p2->next=NULL;
	p1=head;
	for(i=0;i<26;i++)
	{
		a[i]=i+65;
		c[i]=0;
	}
	for(j=0;j<m;j++)
	{
		for(i=0;i<26;i++)
		{
			n=strlen(p1->writer);
			for(k=0;k<n;k++)
			{
				if(a[i]==p1->writer[k])
				{
					c[i]++;
				}
			}
		}
		p1=p1->next;
	}
	max=0;
	for(i=0;i<26;i++)
	{
		if(c[i]>c[max])
		{
			max=i;
		}
	}
	printf("%c\n%d\n",a[max],c[max]);
	p1=head;
	for(i=0;i<m;i++)
	{
		n=strlen(p1->writer);
		for(j=0;j<n;j++)
		{
			if(p1->writer[j]==a[max])
			{
				printf("%d\n",p1->num);
			}
		}
		p1=p1->next;
	}
	return 0;
}
void main()
{
	char s[400][400],t[400][400];
	int n,m,i,j,k,l,p,y,z;
	char c;
	int a[30];
	scanf("%d",&n);
	for(i=1;i<=n;i++)
		scanf("%s%s",t[i],s[i]);
	j=0;
	for(c=65;c<91;c++)
	{
		p=0;
		for(k=1;k<=n;k++)
		{
			l=strlen(s[k]);
			for(m=0;m<l;m++)
			{
				if(s[k][m]==c)
					p++;
			}
		}
		a[j]=p;
		j++;
	}
	for(i=0;i<j;i++)
	{
		for(m=j-2;m>=i;m--)
		{
			if(a[m]<a[m+1])
			{y=a[m];a[m]=a[m+1];a[m+1]=y;}
		}
	}
	z=a[0];
	for(c=65;c<91;c++)
	{
		p=0;
		for(k=1;k<=n;k++)
		{
			l=strlen(s[k]);
			for(m=0;m<l;m++)
			{
				if(s[k][m]==c)
					p++;
			}
		}
		if(p==z)
		{
			printf("%c\n",c);
			printf("%d\n",z);
	
		for(k=1;k<=n;k++)
		{
			p=0;
			l=strlen(s[k]);
			for(m=0;m<l;m++)
			{
				if(s[k][m]==c)
					p++;
			}
			if(p>0)
				printf("%s\n",t[k]);
		}
		break;
		}
	}
}
int main(){
    struct book{
        int num;
        char name[26];
    };
    int n,i,j,a[26]={0},len[1000],k,max=0;
    struct book list[1000];
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%d",&list[i].num);
        scanf("%s",list[i].name);
        len[i]=strlen(list[i].name);
    }
    for(i=0;i<26;i++){
        for(j=0;j<n;j++){
            for(k=0;k<len[j];k++){
                if(list[j].name[k]==i+65){
                    a[i]++;
                    break;
                }
            }
        }
    }
    for(i=0;i<26;i++){
        if(a[i]>max){
            max=a[i];
            k=i;
        }
    }
    printf("%c\n",k+65);
    printf("%d\n",max);
    for(i=0;i<n;i++){
        for(j=0;j<len[i];j++){
            if(list[i].name[j]==k+65){
                printf("%d\n",list[i].num);
            }
        }
    }
    return 0;
}
struct book
{
	int num;
	char w[100];
}book[100];
void main()
{
	int i,j,k,l,m,n,p,b[26]={0};
	scanf ("%d\n",&n);
	for (i=0;i<n;i++)
	{
		scanf ("%d %s",&book[i].num,book[i].w);
	}
	for (i=0;i<n;i++)
	{
		for (j=0;book[i].w[j]!='\0';j++)
		{
			    if (book[i].w[j]=='A')   b[0]++;
				else if (book[i].w[j]=='B') b[1]++;
				else if (book[i].w[j]=='C') b[2]++;
				else if (book[i].w[j]=='D') b[3]++;
				else if (book[i].w[j]=='E') b[4]++;
				else if (book[i].w[j]=='F') b[5]++;
				else if (book[i].w[j]=='G') b[6]++;
				else if (book[i].w[j]=='H') b[7]++;
				else if (book[i].w[j]=='I') b[8]++;
				else if (book[i].w[j]=='J') b[9]++;
				else if (book[i].w[j]=='K') b[10]++;
				else if (book[i].w[j]=='L') b[11]++;
				else if (book[i].w[j]=='M') b[12]++;
				else if (book[i].w[j]=='N') b[13]++;
				else if (book[i].w[j]=='O') b[14]++;
				else if (book[i].w[j]=='P') b[15]++;
				else if (book[i].w[j]=='Q') b[16]++;
				else if (book[i].w[j]=='R') b[17]++;
				else if (book[i].w[j]=='S') b[18]++;
				else if (book[i].w[j]=='T') b[19]++;
				else if (book[i].w[j]=='U') b[20]++;
				else if (book[i].w[j]=='V') b[21]++;
				else if (book[i].w[j]=='W') b[22]++;
				else if (book[i].w[j]=='X') b[23]++;
				else if (book[i].w[j]=='Y') b[24]++;
				else if (book[i].w[j]=='Z') b[25]++;
		}
	}
	for (i=0;i<=25;i++)
	{
		for (j=0;j<26;j++)
		{
			if (b[i]<b[j])
				break;
		}
		if (j==26)
		{
			printf ("%c\n%d\n",65+i,b[i]);
			break;
		}
	}
	for (j=0;j<n;j++)
	{
		for (l=0;book[j].w[l]!='\0';l++)
		{
			if (book[j].w[l]==65+i)
			{
				printf ("%d\n",book[j].num);
				break;
			}
		}
	}
}
int main()
{
    int n,i,j,k;
    scanf("%d\n",&n);
    
    struct book
    {
    int num;
    char name[26];
     }book[999];

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

    struct author
    {
    char l;
    int count;
     }au[26];

    for(i=0;i<26;i++)
    { au[i].l=65+i;
      au[i].count=0;
     }

    for(i=0;i<26;i++)
    { for(j=0;j<n;j++)
        {  for(k=0;k<26;k++)
             {if(au[i].l==book[j].name[k])
                 {au[i].count++;
                  break;
                  }
             }    
         }
    }

    int max=0;
    for(i=1;i<26;i++)
    { if(au[max].count<au[i].count)
           max=i;
     }
    printf("%c\n%d\n",au[max].l,au[max].count);

    for(j=0;j<n;j++)
    { for(k=0;k<26;k++)
      {
       if(au[max].l==book[j].name[k])
          { printf("%d\n",book[j].num);
            break;
           }
       }
     }
    return 0;
}
struct book
{
	int num;
	char *name;
	struct book *next;
}

main()
{
	int n,i;
	scanf("%d",&n);
	struct book *p1,*p2,*head;
	p1=len;
	head=p1;
	for(i=0;i<n;i++)
	{
		p1->name=(char *)malloc(26*1);
		scanf("%d %s",&p1->num,p1->name);
		p2=len;
		p1->next=p2;
		p1=p2;
	}
	p1=p2=head;
	int *a;
	a=(int *)malloc(26*4);
	for(i=0;i<26;i++)
		*(a+i)=0;
	int j;
	int l;
	for(i=0;i<n;i++)
	{
		j=0;
		while(*(p1->name+j)!='\0')
		{
			l=*(p1->name+j)-'A';
			*(a+l)+=1;
			j+=1;
		}
		p1=p1->next;
	}
	int max=0,maxl;
	for(i=0;i<26;i++)
		if(*(a+i)>max)
		{
			max=*(a+i);
			maxl='A'+i;
		}
	printf("%c\n%d\n",maxl,max);
	p1=p2=head;
	for(i=0;i<n;i++)
	{
		j=0;
		while(*(p1->name+j)!='\0')
		{
			if(*(p1->name+j)==maxl)
			{
				printf("%d\n",p1->num);
				break;
			}
			j+=1;
		}
		p1=p1->next;
	}
}
struct book
{
	int num;
	char author[27];
}book[1000];

void main()
{
	int m,i,j,k;
	char s[26];
	int w[26]={0};
	int len[1000];
	int max,most;
	scanf("%d",&m);
	for(i=0;i<m;i++)
	{
		scanf("%d %s",&book[i].num,book[i].author);
	}
	for(i=0;i<26;i++)
	{
		s[i]='A'+i;
	}
	for(i=0;i<m;i++)
	{
		len[i]=strlen(book[i].author);
		for(j=0;j<len[i];j++)
		{
			for(k=0;k<26;k++)
			{
				if(book[i].author[j]==s[k])
					w[k]++;
			}
		}
	}
	max=w[0];
	most=0;
	for(i=0;i<26;i++)
	{
		if(w[i]>max)
		{
			max=w[i];
			most=i;
		}
	}
	printf("%c\n%d\n",s[most],max);
	for(i=0;i<m;i++)
	{
		len[i]=strlen(book[i].author);
		for(j=0;j<len[i];j++)
		{
			if(book[i].author[j]==s[most])
				printf("%d\n",book[i].num);
		}
	}
}
int main()
{
	int n;char name[1000][26];int num[1000];
	int i,j;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",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d%s",&num[i],name[i]);
	}
	int a[26]={0};char k;
	for(i=0;i<n;i++)
	{
		for(j=0;(k=name[i][j]!='\0');j++)
		{
			if(name[i][j]=='A')
				a[0]++;
			if(name[i][j]=='B')
				a[1]++;
			if(name[i][j]=='C')
				a[2]++;
			if(name[i][j]=='D')
				a[3]++;
			if(name[i][j]=='E')
				a[4]++;
			if(name[i][j]=='F')
				a[5]++;
			if(name[i][j]=='G')
				a[6]++;
			if(name[i][j]=='H')
				a[7]++;
			if(name[i][j]=='I')
				a[8]++;
			if(name[i][j]=='J')
				a[9]++;
			if(name[i][j]=='K')
				a[10]++;
			if(name[i][j]=='L')
				a[11]++;
			if(name[i][j]=='M')
				a[12]++;
			if(name[i][j]=='N')
				a[13]++;
			if(name[i][j]=='O')
				a[14]++;
			if(name[i][j]=='P')
				a[15]++;
			if(name[i][j]=='Q')
				a[16]++;
			if(name[i][j]=='R')
				a[17]++;
			if(name[i][j]=='S')
				a[18]++;
			if(name[i][j]=='T')
				a[19]++;
			if(name[i][j]=='U')
				a[20]++;
			if(name[i][j]=='V')
				a[21]++;
			if(name[i][j]=='W')
				a[22]++;
			if(name[i][j]=='X')
				a[23]++;
			if(name[i][j]=='Y')
				a[24]++;
			if(name[i][j]=='Z')
				a[25]++;
		}
	}
	int max=a[0];int o=0;
	for(i=0;i<26;i++)
	{
		if(a[i]>max)
		{max=a[i];o=i;}
	}
	printf("%c\n%d\n",b[o],a[o]);
	for(i=0;i<n;i++)
	{
		for(j=0;(k=name[i][j]!='\0');j++)
		{
			if(name[i][j]==b[o])
				printf("%d\n",num[i]);
		}

	}
	scanf("%d",&i);


	return 0;
}
void main() 
{ 
int n,m,i,j,k,t,max=0; 
int a[1000],b[26]={0}; 
char s[1000][30]; 
char c; 
scanf("%d",&n); 
for(i=0;i<n;i++) 
scanf("%d %s",&a[i],s[i]); 
for(i=0;i<n;i++) 
{ 
m=strlen(s[i]); 
for(j=0;j<m;j++) 
{ 
t=s[i][j]-65; 
b[t]++; 
} 
} 
for(i=0;i<26;i++) 
if(b[i]>=max) max=b[i]; 
for(i=0;i<26;i++) 
{ 
if(b[i]==max) 
{ 
k=i; 
c=i+65; 
printf("%c\n",c); 
printf("%d\n",max); 
} 
} 
for(i=0;i<n;i++) 
{ 
m=strlen(s[i]); 
for(j=0;j<m;j++) 
if(s[i][j]==65+k) printf("%d\n",a[i]); 
} 
}
struct book
{
	int num;
	char name[27];
};
int main()
{
	int n,i,j,l,sum[26],t=0,T=0;struct book a[1000];memset(sum,0,sizeof(sum));char A;
	cin >> n;
	for(i=0;i<n;i++)
	{
		cin >> a[i].num >> a[i].name;
		l=strlen(a[i].name);
		for(j=0;j<l;j++)
		{
			sum[a[i].name[j]-'A']++;
		}
	}
	for(i=0;i<26;i++)
	{
		if(sum[i]>t)
		{
			t=sum[i];T=i;
		}
	}
	A='A'+T;
	cout << A << endl;
	cout << t << endl;
	for(i=0;i<n;i++)
	{
		for(j=0;j<27;j++)
		{
			if(a[i].name[j]==A)
				cout << a[i].num << endl;
		}
	}
	return 0;
}
struct book
{
	int id;
	char str[27];
}bo[1000];
struct people
{
	int name;
	int number;
	int book_number[1000];
}people[26];
int main ( )
{
	int n, i, j, k, m, max = 0;
	char a[27] = {'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','\0'};
	cin >> n;
	for(i = 0;i < n;i++)
	{
		cin >> bo[i].id >> bo[i].str;
	}
	for(i = 0;i < 26;i++)//???
	{
		people[i].number = 0;
	}
	for(i = 0;i < n;i++)
	{
		m = strlen(bo[i].str);
		for(j = 0;j < m;j++)
		{
			for(k = 0;k < 26;k++)//???????????
			{
				if(bo[i].str[j] == a[k])
				{
					people[k].book_number[people[k].number] = bo[i].id;
					people[k].number++;
				}
			}
		}
	}
	j = 0;
	for(i = 0;i < 26;i++)//?????????
	{
		if(people[i].number > max)
		{
			j = i;
			max = people[i].number;
		}
	}
	cout << a[j] << endl;
	cout << people[j].number << endl;
	for(i = 0;i < people[j].number;i++)
	{
		cout << people[j].book_number[i] << endl;
	}
	return 0;
}
main(){
	int i, sum[26]={0}, m, j, max=0, p;
	struct book{
		int num;
		char au[27];
		int l;
	};
	struct book bk[1000];
	scanf("%d", &m);
	for(i=0; i<m; i++){
		scanf("%d %s", &bk[i].num, bk[i].au);
		bk[i].l=strlen(bk[i].au);
		for(j=0; j<bk[i].l; j++){
			switch(bk[i].au[j]){
			case 'A': sum[0]+=1; break;
			case 'B': sum[1]+=1; break;
			case 'C': sum[2]+=1; break;
			case 'D': sum[3]+=1; break;
			case 'E': sum[4]+=1; break;
			case 'F': sum[5]+=1; break;
			case 'G': sum[6]+=1; break;
			case 'H': sum[7]+=1; break;
			case 'I': sum[8]+=1; break;
			case 'J': sum[9]+=1; break;
			case 'K': sum[10]+=1; break;
			case 'L': sum[11]+=1; break;
			case 'M': sum[12]+=1; break;
			case 'N': sum[13]+=1; break;
			case 'O': sum[14]+=1; break;
			case 'P': sum[15]+=1; break;
			case 'Q': sum[16]+=1; break;
			case 'R': sum[17]+=1; break;
			case 'S': sum[18]+=1; break;
			case 'T': sum[19]+=1; break;
			case 'U': sum[20]+=1; break;
			case 'V': sum[21]+=1; break;
			case 'W': sum[22]+=1; break;
			case 'X': sum[23]+=1; break;
			case 'Y': sum[24]+=1; break;
			case 'Z': sum[25]+=1; break;
			}
		}
	}
	for(i=0; i<26; i++){
		if(sum[i]>max){
			max=sum[i];
			p=i;
		}
		else;
	}
	printf("%c\n%d", p+65, max);
	for(i=0; i<m; i++){
		for(j=0; j<bk[i].l; j++){
			if(bk[i].au[j]==p+65){
				printf("\n%d", bk[i].num);
				break;
			}
			else;
		}
	}
}
int main ()
{
    struct book
    {
        int num;
        char name[27];
    }b[1000];
    int m,i,j,a=0;
    int c[26];
    scanf("%d",&m);
    for (i=0;i<m;i++)
        scanf("%d%s",&b[i].num,b[i].name);
    for (i=0;i<m;i++)
    {
        for (j=0;j<strlen(b[i].name);j++)
            c[*(b[i].name+j)-'A']++;
    }
    for (i=0;i<26;i++)
        a=c[i]>c[a]?i:a;
    printf("%c\n",a+'A');
    printf("%d\n",c[a]);
    for (i=0;i<m;i++)
    {
        for (j=0;j<strlen(b[i].name);j++)
        {
            if ( *(b[i].name+j)==('A'+a))
                printf("%d\n",b[i].num);
        }
    }
return 0;
}