semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	int n;
	scanf("%d",&n);
	struct writer{
		int sum;
		char c;
	}lit[26]={0,'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'};
	struct book{
		int id;
		char name[26];
	}data[1000];
	int i,j,k;
	for(i=0;i<n;i++)
	{
		scanf("%d%s",&data[i].id,&data[i].name);
		for(j=0;data[i].name[j]!='\0';j++)
        {
			for(k=0;k<26;k++)
			{
				if(data[i].name[j]==lit[k].c)
					lit[k].sum++;
			}
		}
	}
	for(i=1;i<26;i++)
	{
		if(lit[i].sum<lit[i-1].sum)
		{
			struct writer tmp;
			tmp=lit[i-1];
			lit[i-1]=lit[i];
			lit[i]=tmp;
		}
	}
	printf("%c\n%d\n",lit[25].c,lit[25].sum);
	for(i=0;i<n;i++)
	{
		for(j=0;data[i].name[j]!='\0';j++)
		{
			if(data[i].name[j]==lit[25].c)
				printf("%d\n",data[i].id);
		}
	}
	return 0;
}
void main()
{
	struct ts
	{
		int sl;
		char zz[30];
//		int zzsl;
		struct ts *next;
	};
	struct ts *p1,*p2,*head;
	int i,j,k,m,n,max,zzzdnum,num[100]={0};
	char zzzd;//??????^^
	scanf("%d",&n);
	p1=p2=head=(struct ts *)malloc(sizeof(struct ts));
	scanf("%d %s",&p1->sl,p1->zz);
//	p1->zzsl=strlen(p1->zz);//?????
	for(i=1;i<n;i++)
	{
		p1=(struct ts *)malloc(sizeof(struct ts));
		scanf("%d %s",&p1->sl,p1->zz);
//		p1->zzsl=strlen(p1->zz);
		p2->next=p1;
		p2=p1;
	}
	p1->next=0;//??NULL???????
	for(i='A';i<='Z';i++)
	{
		p1=head;
		for(k=0;k<n;k++)
		{
			for(j=0;p1->zz[j]!='\0';j++)
			{
				if(p1->zz[j]==i)num[i]++;
			}
			p1=p1->next;
		}
	}
	max=0;
	for(i='A';i<='Z';i++)
	{
		max=max>num[i]?max:num[i];//?????????
	}
	for(i='A';i<='Z';i++)
	{
		if(num[i]==max)zzzd=i;//????????
	}
	printf("%c\n%d\n",zzzd,max);
	p1=head;
//zzdnum=0;
	for(i=0;i<n;i++)
	{
		for(j=0;p1->zz[j]!='\0';j++)
		{
			if(p1->zz[j]==zzzd)//?????????
			{
				printf("%d\n",p1->sl);
			}
		}
		p1=p1->next;
	}
}
struct book
{
       int id;
       char c[27];
};
int main()
{
    void number_of_books(int n,int *p,struct book book[1000]);
    char max(int n,int *p,struct book book[1000]);
    void name_of_book(int n,int *p,struct book book[1000],int m);
    int *p;
    char s[100],m;
    struct book book[1000];
    int n,i;
    p=(int *)calloc(257,sizeof(int));
    scanf("%d\n",&n);
    for(i=0;i<n;i++)
    {
                    scanf("%d %s",&book[i].id,&book[i].c);
    }
    number_of_books(n,p,book);
    m=max(n,p,book);
    printf("%c\n%d\n",m,(*(p+m)));
    name_of_book(n,p,book,m);
    
    return 0;
}

void number_of_books(int n,int *p,struct book book[1000])
{
     int i,j;
     for(i=65;i<91;i++)
     {
                  (*(p+i))=0;
     }
     for(i=0;i<n;i++)
     {
                     for(j=0;book[i].c[j]!='\0';j++)
                     {
                                                    (*(p+book[i].c[j]))++;
                     }
     }
}  

char max(int n,int *p,struct book book[1000])
{
     int i,k=0;
     char m;
     for(i=65;i<91;i++)
     {
                       if((*(p+i))>k)
                       {
                                     k=(*(p+i));
                                     m=i;
                       }
     }
     return (m);
}

void name_of_book(int n,int *p,struct book book[1000],int m)
{
     int i,j;
     for(i=0;i<n;i++)
     {
                     for(j=0;book[i].c[j]!='\0';j++)
                     {
                                                    if((book[i].c[j])==m)
                                                    {
                                                                         printf("%d\n",book[i].id);
                                                                         break;
                                                    }
                     }
     }
}
struct book
{
	int num;
	char writer[27];
	struct book *next;
}*head;
int times[26];

void create(int m)
{
	struct book *p1,*p2;
	int i;
	for (i=0;i<=m-1;i++)
	{
		p1=(struct book *)malloc(sizeof(struct book));
		scanf("%d",&p1->num);
		scanf("%s",p1->writer);
		if (!i) head=p1;
		else p2->next=p1;
		p2=p1;
	}
	p2->next=NULL;
}
int count()
{
	int max,l,i;
	char temp[27];
	struct book *p1;
	for (i=0;i<=25;i++) times[i]=0;
	p1=head;
	while (p1!=NULL)
	{
		l=strlen(p1->writer);
		strcpy(temp,p1->writer);
		for (i=0;i<=l-1;i++)
			times[temp[i]-65]++;
		p1=p1->next;
	}
	max=0;
	for (i=0;i<=25;i++)
		if (times[i]>times[max]) max=i;
	return(max);
}
void print(int max)
{
	struct book *p1;
	int abc[999],total,l,i;
	char temp[27];

	total=0;
	printf("%c\n",max+65);
	p1=head;
	while (p1!=NULL)
	{
		strcpy(temp,p1->writer);
		l=strlen(temp);
		for (i=0;i<=l-1;i++)
			if (max+65==temp[i]) break;
		if (i<l)
		{
			abc[total]=p1->num;
			total++;
		}
		p1=p1->next;
	}
	printf("%d\n",total);
	for (i=0;i<=total-1;i++)
	{
		printf("%d\n",abc[i]);
	}
}
void main()
{
	int max,m;
	scanf("%d",&m);
	create(m);
	max=count();
	print(max);
}
struct book
{
	int id;
	char author[27];
	struct book *next;
};

struct book *creat()
{
	int n , i;
	scanf("%d",&n);
	struct book *p1,*head,*p0;
	head = NULL;
	p1 = head;
	for ( i = 0 ; i < n ; i ++)
	{
		p0 = (struct book *)malloc(sizeof(struct book));
		scanf("%d %s" , &p0->id , p0->author );
		if( head == NULL )
		{
			p1 = p0;
			head = p1;
			p0->next = NULL;
		}
		else
		{
			p1->next = p0;
			p0->next = NULL;
			p1 = p0;
		}
	}
	return (head);
}
char best(struct book *head)
{
	int i , max , a[26]  ;
	struct book *p;
	p = head;
	for (i = 0;i < 26;++i) a[i] = 0;
	while(p != NULL)
	{
		i = 0;
		while( p->author[i] != '\0')
		{
			a[p->author[i]-'A']++;
			i ++;
		}
		p = p->next;
	}
	for(i = 0 ; i < 26 ; i ++ )
	{
		if ( i == 0 ) max = i;
		else if ( a[i] > a[max]) max = i;
	}
	return ('A'+max);
}
void print(char x , struct book *head )
{
	int i,k = 0;
	char a = x;
	struct book *p = head;
	while(p != NULL)
	{
		i = 0 ;
		while ( p->author[i] != '\0' )
		{
			if(p->author[i] == a)
			{
				k ++;
				break;
			}
			i ++;
		}
		p = p->next;
	}
	printf("%c\n%d\n" , a , k);
	p = head;
	while(p != NULL)
	{
		i = 0;
		while ( p->author[i] != '\0' )
		{
			if(p->author[i] == a)
			{
				printf("%d\n",p->id);
				break;
			}
			i ++;
		}
		p = p->next;
	}
}

int main(int argc, char* argv[])
{
	char writer;
	struct book *head;
	head = creat();
	writer = best(head);
	print(writer,head);
	return 0;
}
int Book_num(char a[])
{
	int j,num;
	j=1;
	if((j=1)&&a[j]==' ')
	{
		num=a[0]-48;
	}
	else j++;
	if((j=2)&&a[j]==' ')
	{
		num=a[1]-48+(a[0]-48)*10;
	}
	else j++;
	if((j=3)&&a[j]==' ')
	{
		num=a[2]-48+(a[1]-48)*10+(a[0]-48)*100;
	}
	return num;
}

int main()
{
	int m,bk1,i,max,j,wrt;
	int author[26][999]={0};
	char data[999][30];
	scanf("%d\n",&m);
	for(i=0;i<m;i++)
	{
		gets(data[i]);
		data[i][strlen(data[i])]='\0';
	}
	max=0;
	for(i=0;i<m;i++)
	{
		for(j=0;data[i][j]!='\0';j++)
		{
			if(data[i][j]>64)
			{
				wrt=data[i][j]-65;	
				for(bk1=0;author[wrt][bk1]!=0;bk1++)
				{;}
				author[wrt][bk1]=Book_num(data[i]);
				if(bk1>max)
				{
					max=bk1;
				}
			}
		}
	}
	for(i=0;i<26;i++)
	{
		if(author[i][max]!=0)
		{
			printf("%c\n",i+65);
			printf("%d\n",max+1);
			for(j=0;j<=max;j++)
			{
				printf("%d\n",author[i][j]);
			}
			break;
		}
	}
	return 0;
}
struct library
{
	int num;
	char aut[30];
	struct library *next;
}
main()
{
	int m,i,j,a[30],t,b[30],x=0;
	char name;
	struct library *head;
	struct library *p1,*p2,*p;
	for(i=0;i<26;i++)
	{
		a[i]=0;
		b[i]=0;
	}
	scanf("%d",&m);
	p1=p2=(struct library*) malloc(LEN);
	scanf("%d %s",&p1->num,p1->aut);
	head=p1;
	p2=p1;
	for(i=0;i<m-1;i++)
	{
		p1=(struct library*) malloc(LEN);
		scanf("%d %s",&p1->num,p1->aut);
		p2->next=p1;
		p2=p1;
	}
	p1->next=NULL;
	p=head;
	for(i=0;i<m;i++)
	{
		for(j=0;j<26;j++)
		{
			if(p->aut[j]=='A') a[0]=a[0]+1;
			if(p->aut[j]=='B') a[1]=a[1]+1;
			if(p->aut[j]=='C') a[2]=a[2]+1;
			if(p->aut[j]=='D') a[3]=a[3]+1;
			if(p->aut[j]=='E') a[4]=a[4]+1;
			if(p->aut[j]=='F') a[5]=a[5]+1;
			if(p->aut[j]=='G') a[6]=a[6]+1;
			if(p->aut[j]=='H') a[7]=a[7]+1;
			if(p->aut[j]=='I') a[8]=a[8]+1;
			if(p->aut[j]=='J') a[9]=a[9]+1;
			if(p->aut[j]=='K') a[10]=a[10]+1;
			if(p->aut[j]=='L') a[11]=a[11]+1;
			if(p->aut[j]=='M') a[12]=a[12]+1;
			if(p->aut[j]=='N') a[13]=a[13]+1;
			if(p->aut[j]=='O') a[14]=a[14]+1;
			if(p->aut[j]=='P') a[15]=a[15]+1;
			if(p->aut[j]=='Q') a[16]=a[16]+1;
			if(p->aut[j]=='R') a[17]=a[17]+1;
			if(p->aut[j]=='S') a[18]=a[18]+1;
			if(p->aut[j]=='T') a[19]=a[19]+1;
			if(p->aut[j]=='U') a[20]=a[20]+1;
			if(p->aut[j]=='V') a[21]=a[21]+1;
			if(p->aut[j]=='W') a[22]=a[22]+1;
			if(p->aut[j]=='X') a[23]=a[23]+1;
			if(p->aut[j]=='Y') a[24]=a[24]+1;
			if(p->aut[j]=='Z') a[25]=a[25]+1;
			if(p->aut[j]=='\0') break;
		}
		p=p->next;
	}
	t=0;
	for(i=1;i<26;i++)
	{
		if(a[t]<a[i]) t=i;
	}
	if(t==0)
	{
		printf("A\n");
		name='A';
	}
	if(t==1)
	{
		printf("B\n");
		name='B';
	}
	if(t==2)
	{
		printf("C\n");
		name='C';
	}
	if(t==3)
	{
		printf("D\n");
		name='D';
	}
	if(t==4)
	{
		printf("E\n");
		name='E';
	}
	if(t==5)
	{
		printf("F\n");
		name='F';
	}
	if(t==6)
	{
		printf("G\n");
		name='G';
	}
	if(t==7)
	{
		printf("H\n");
		name='H';
	}
	if(t==8)
	{
		printf("I\n");
		name='I';
	}
	if(t==9)
	{
		printf("J\n");
		name='J';
	}
	if(t==10)
	{
		printf("K\n");
		name='K';
	}
	if(t==11)
	{
		printf("L\n");
		name='L';
	}
	if(t==12)
	{
		printf("M\n");
		name='M';
	}
	if(t==13)
	{
		printf("N\n");
		name='N';
	}
	if(t==14)
	{
		printf("O\n");
		name='O';
	}
	if(t==15)
	{
		printf("P\n");
		name='P';
	}
	if(t==16)
	{
		printf("Q\n");
		name='Q';
	}
	if(t==17)
	{
		printf("R\n");
		name='R';
	}
	if(t==18)
	{
		printf("S\n");
		name='S';
	}
	if(t==19)
	{
		printf("T\n");
		name='T';
	}
	if(t==20)
	{
		printf("U\n");
		name='U';
	}
	if(t==21)
	{
		printf("V\n");
		name='V';
	}
	if(t==22)
	{
		printf("W\n");
		name='W';
	}
	if(t==23)
	{
		printf("X\n");
		name='X';
	}
	if(t==24)
	{
		printf("Y\n");
		name='Y';
	}
	if(t==25)
	{
		printf("Z\n");
		name='Z';
	}
	printf("%d\n",a[t]);
	p=head;
	for(i=0;i<m;i++)
	{
		for(j=0;j<26;j++)
		{
			if(p->aut[j]==name)
			{
				b[x]=p->num;
				x=x+1;
				break;
			}
		}
		p=p->next;
	}
	for(i=0;i<x-1;i++) printf("%d\n",b[i]);
	printf("%d",b[i]);
}
int main()
{
    int n, count[30] = {0}, num[30][1000] = {0};
    cin >> n;
    while (n--)
    {
        int no;
        char c;
        cin >> no;
        cin.get();
        while ((c = cin.get()) != '\n')
        {
            num[c - 'A'][count[c - 'A']++] = no;
        }
    }
    int max =count[0], set = 0;
    for (int i = 1; i < 26; i++)
    {
        if (max < count[i])
        {
            max = count[i];
            set = i;
        }
    }
    cout << (char) (set + 'A') << endl << max << endl;
    for (int i = 0; i < max; i++)
    {
        cout << num[set][i] << endl;
    }
 
    return 0;
}
struct book
{
    int id;
    char zz[26];
} b[999];
int main()
{
    int m,n,i,num[26]={0},maxz,j;
    char string[26];
    scanf("%d",&m);
    for(i=0;i<m;i++)
    {
        scanf("%d %s",&b[i].id,&b[i].zz);
        for(j=0;b[i].zz[j]!='\0';j++)
        num[b[i].zz[j]-'A']++;
    }
    int max=0;
    for(i=0;i<26;i++)
     if(max<num[i]) { max=num[i]; maxz=i;}
    printf("%c\n%d",maxz+65,max);
    for(i=0;i<m;i++)
     for(j=0;b[i].zz[j]!='\0';j++)
      {if(b[i].zz[j]==maxz+65) printf("\n%d", b[i].id);
        else continue;}
}
struct list
{
	int num;
	char author[26];
};

struct number 
{
	int a;
	int time;
};

int main()
{
	int i,j,m,k,length;
	struct list book[100];
	struct number name[26],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++)
	{
		name[i].a=i;
		name[i].time=0;
	}

	for(i=0;i<m;i++)
	{
		length=strlen(book[i].author);
        for(j=0;j<length;j++)
		{
			k=(book[i].author[j]);
			name[k-65].time++;
		}
	}

	most=name[0];

	for(i=1;i<26;i++)
	{
		if(name[i].time>most.time){
			most=name[i];
		}
	}

	printf("%c\n%d\n",most.a+65,most.time);
    
	for(i=0;i<m;i++)
	{
		length=strlen(book[i].author);

		for(j=0;j<length;j++)
		{
			k=(book[i].author[j]);
			if(most.a+65==k){
				printf("%d\n",book[i].num);
			}
		}
	}
	return 0;
}
void main()
{
	struct tushu
	{
		int num;
		char zuozhe[27];
	}ts[999];

	int i,j,n,k,temp;
	int count[26]={0};

	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d %s",&ts[i].num,ts[i].zuozhe);
		for(j=0;ts[i].zuozhe[j]!='\0';j++)
		{count[ts[i].zuozhe[j]-65]++;}
	}
	temp=count[0];
	k=0;
	for(i=0;i<26;i++)
	{
		if(count[i]>temp){k=i;temp=count[i];}
	}
	printf("%c\n",k+65);
	printf("%d\n",count[k]);
	for(i=0;i<n;i++)
	{
		for(j=0;ts[i].zuozhe[j]!='\0';j++)
		{
			if(ts[i].zuozhe[j]==k+65)
			{
				printf("%d\n",ts[i].num);
				break;
			}
		}
	}
}
int main()
{
	struct x
	{int num;
	char name[26];
	}book[1000];
	int i,j,m,n,k,ex;
	int a[26][1000];
	int count[26]={0},num[26]={65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90};
	scanf("%d",&m);
	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])
		{
			ex=count[i];
			count[i]=count[i+1];
			count[i+1]=ex;
			ex=num[i];
			num[i]=num[i+1];
			num[i+1]=ex;
		}
	}
	printf("%c\n%d\n",num[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]==num[25])
				printf("%d\n",book[i].num);
		}
	}
	return 0;
}
int main()
{
	int a[26][999],t,i,n[26],k,j,b=0;
	char x[27];
	scanf("%d",&t);
	for(i=0;i<26;i++)
	{
		n[i]=0;
	}
	for(i=0;i<t;i++)
	{
		scanf("%d%s",&k,x);
		for(j=0;x[j]!='\0';j++)
		{
			a[x[j]-65][n[x[j]-65]]=k;
			n[x[j]-65]++;
		}
	}
	for(i=0;i<26;i++)
	{
		if(n[i]>b)
		{
			b=n[i];
			j=i;
		}
	}
	printf("%c\n",j+65);
	printf("%d\n",n[j]);
	for(i=0;i<n[j];i++)
	{
		printf("%d\n",a[j][i]);
	}
	return 0;
}
int main()
{
	struct author
	{
		char nm;
		int bk[999];
		int count;
	};
	struct author a[26];
	struct author max;
	struct book
	{
		char at[26];
		int no;
	};
	struct book b;
	int i,j,n,m,k,flag;
	for(i=0;i<26;i++)
	{
		a[i].count=0;
		a[i].nm=65+i;
	}
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d%s",&b.no, b.at);
		m=strlen(b.at);
		flag=0;
		for(j=0;j<m;j++)
		{
			for(k=0;k<26;k++)
			{
				if(b.at[j]==a[k].nm)
				{
					a[k].bk[a[k].count]=b.no;
					a[k].count++;
					flag++;
					break;
				}
			}
			if(flag==m)
				break;
		}
	}
	max=a[0];
	for(i=1;i<26;i++)
	{
		if(a[i].count>max.count)
		{
			max=a[i];
		}
	}
	printf("%c\n%d\n",max.nm,max.count);
	for(i=0;i<max.count;i++)
	{
		printf("%d\n",max.bk[i]);
	}
	return 0;
}
struct book
{char name[26];
int number;
}a[1000];
void main()
{ 
	int n,i,j,b[26]={0},max=0,t;
	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d %s",&a[i].number,a[i].name);
	for(i=0;i<n;i++)
		for(j=0;a[i].name[j]!='\0';j++)
			b[a[i].name[j]-65]++;
	for(i=0;i<26;i++)
		if(max<b[i])
			max=b[i];
	for(i=0;i<26;i++)
		if(max==b[i])
		{
			t=i;
	break;
		}
		printf("%c\n%d\n",t+65,b[t]);
		for(i=0;i<n;i++)
		for(j=0;a[i].name[j]!='\0';j++)
		if(a[i].name[j]==t+65)
		{
			printf("%d\n",a[i].number);
		break;
		}
}
struct book
{
	int number;
	char auther[27];
}bk[1000];

struct ath
{
	char a;
	int books[999];
	int sum;
}auth[27],temp;

void main()
{
	int n,i,x,m,j;
	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d%s",&bk[i].number,bk[i].auther);
	for(i=0;i<27;i++)
	{
		for(j=0;j<999;j++)
			auth[i].books[j]=0;
		auth[i].sum=0;
		auth[i].a='A'+i;
	}
	for(i=0;i<n;i++)
	{
		m=strlen(bk[i].auther);
		int f;
		for(f=0;f<m;f++)
		{
			x=(int)(bk[i].auther[f]-'A');
			auth[x].books[auth[x].sum]=bk[i].number;
			auth[x].sum++;
		}
	}
	for(j=0;j<25;j++)
		for(i=0;i<25-j;i++)
			if(auth[i].sum>auth[i+1].sum)
			{temp=auth[i];auth[i]=auth[i+1];auth[i+1]=temp;}
	printf("%c\n",auth[25].a);
	printf("%d\n",auth[25].sum);
	i=0;
	while(auth[25].books[i]!=0)
	{printf("%d\n",auth[25].books[i]);i++;}
}
/*
 * 1.cpp
 *
 *  Created on: 2013-1-13
 *      Author: Administrator
 */
int main()
{
	int n, i, j, max = 0, maxi = 0;
	int a[1100] = {0}, b[30] = {0}, c[30][1100] = {0};
	char zz[1100][30];
	cin >> n;
	for(i = 1; i <= n; i++)
	{
		cin >> a[i] >> zz[i];
		for(j = 0; zz[i][j] != '\0'; j++)
		{
			b[(int)zz[i][j] - 'A']++;
			c[(int)zz[i][j] - 'A'][i] = 1;
		}
	}
	for(i = 0; i <= 25; i++)
	{
		if(b[i] > max)
		{
			max = b[i];
			maxi = i;
		}
	}
	cout << (char)(maxi + 'A') << endl;
	cout << max << endl;
	for(i = 1; i <= 1000; i++)
	{
		if(c[maxi][i] == 1)
			cout << a[i] << endl;
	}
	return 0;
}
struct book
{   int  num;
    char peo[26];
} book[999];

int main()
{   char zm,max;
	int n,i,k,num,cishu=-1;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
                scanf("%d %s",&book[i].num,&book[i].peo);
	}
   for(zm='A';zm<='Z';zm++){
	  	 num=0;
	     	 for(i=0;i<n;i++){
		     for(k=0;k<26;k++){
		     if(book[i].peo[k]==zm)
			 num++;
			 }
		   }
		     if(num>cishu){
		     cishu=num;
		     max=zm;	 
		   }
		}
	printf("%c\n",max);
	printf("%d\n",cishu);
         for(i=0;i<n;i++){
            for(k=0;k<26;k++){
                   if(book[i].peo[k]==max)
           	   printf("%d\n",book[i].num);
		}
	}
	return 0;
}
int main()
{
	int n,i;
	char wri[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 num[26];//?????????
	char tem[100];
	int j=0,k;
	int shu[26][100];//?????
	int hao;//??
	for(i=0;i<26;i++)
		num[i]=0;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d %s",&hao,tem);
		j=0;
		while(tem[j]!='\0')
		{
			for(k=0;k<=25;k++)
			{
				if(wri[k]==tem[j])
				{
					shu[k][num[k]]=hao;
					num[k]++;
				}
			}
			j++;
		}
	}
	int max=0;
	for(i=1;i<26;i++)
	{
		if(num[i]>num[max])
			max=i;
	}
	printf("%c\n%d\n",wri[max],num[max]);
	for(i=0;i<num[max];i++)
		printf("%d\n",shu[max][i]);
	return 0;
}
void main()
{
	int n,i,j,card[1000],num[26]={0},max=0,k=0;
	char s[1000][27];
	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d %s",&card[i],s[i]);
	for(i=0;i<n;i++)
		for(j=0;s[i][j]!='\0';j++)
			num[s[i][j]-'A']++;
	for(i=0;i<26;i++)
      if(num[i]>max)
	  {max=num[i];k=i;}
	printf("%c\n%d\n",k+'A',max);
	for(i=0;i<n;i++)
		for(j=0;s[i][j]!=0;j++)
			if(s[i][j]==k+'A')
			{printf("%d\n",card[i]);break;}
}
struct book *head;
int abc[26];
struct book
{
	int num;
	char name[1000];
	struct book *next;
};

void ffind(char * name)
{
	while(*name!=0)
	{
		abc[*name-65]++;
		name++;
	}


}
int mfind(char * name,char a)
{
		while(*name!=0)
	{
		if(a==*name)return 1;
		name++;
	}

}

struct book* creat (int max)
{
	int n;
	struct book *p1,*p2;
	n=0;
	p1=p2=(struct book*)malloc(LEN);
	head=0;
	do
	{
		scanf("%d %s",&p1->num,&p1->name);
		ffind(p1->name);
		n++;
		if(n==1)head=p1;
		else p2->next=p1;
		p2=p1;
		p2->next=0;
		p1=(struct book*)malloc(LEN);
	}while(n<max);
	p2->next=0;
	return head;
}

void main()
{
	int n,i;
	int max=0,maxi=0;
	char tt[2];
	struct book *p,*p1;
	scanf("%d",&n);
	p=creat(n);
	p1=p;

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

	printf("%C\n%d\n",65+maxi,max);

	tt[0]=maxi+65;
	tt[1]=0;
	do{
		if(mfind(p1->name,maxi+65)==1){
			max--;
			if(max!=0)
			printf("%d\n",p1->num);
			else printf("%d",p1->num);
		}
		p1=p1->next;
	}while(p1!=0);

}
int main()
{
    int i, j, n;
    struct book
    {
        int no;
        char as[10];
    } bk;

    scanf("%d", &n);
    struct book * books = (struct book *)malloc(sizeof(struct book) * n);

    for (i = 0; i < n; i++) 
    {
        scanf("%d %s", &bk.no, bk.as);
        books[i] = bk;
    }

    int cnts[256] = {0};
    for (i = 0; i < n; i++) 
    {
        bk = books[i];
        for (j = 0; bk.as[j]; j++)
        {
            cnts[bk.as[j]]++;
        }
    }

    int count = 0;
    for (int max = 1000; max > 0; max--)
    {
        for (char c = 'A'; c <= 'Z'; c++)
        {
            if (cnts[c] == max)
            {
                printf("%c\n%d\n", c, max);
                for (i = 0; i < n; i++) 
                {
                    bk = books[i];
                    for (j = 0; bk.as[j]; j++)
                    {
                        if (bk.as[j] == c)
                        {
                            printf("%d\n", bk.no);
                            break;
                        }
                    }
                }
                count++;
            }
        }
        if (count == 1) 
        {
            free(books);
            return 0;
        }
    }

    free(books);
    return -1;
}
int trans(char k)
{
	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 i;
	for(i=0;i<26;i++)
	{
		if(k==a[i])
			return i;
	}
}
		

int main ()
{
	int m;
	scanf("%d",&m);
	struct point 
	{
		int id;
		char au[26];
	}books[1000];
	int num[26];
	int i;
	for(i=0;i<26;i++)
	{
		num[i]=0;
	}
    int j;
	for(i=0;i<m;i++)
	{
		scanf("%d%s",&books[i].id,books[i].au);
	}
	for(i=0;i<m;i++)
	{
		int k;
		k=strlen(books[i].au);
		for(j=0;j<k;j++)
		{   int b;
			b=trans(books[i].au[j]);
			num[b]++;
		}
	}
	int max=0;
	int most;
	for(i=0;i<26;i++)
	{
		if(num[i]>max)
		{
			max=num[i];
			most=i;
		}
	}
	char aumost;
	aumost='A'+most;
	printf("%c\n",aumost);
	printf("%d\n",max);
	for(i=0;i<m;i++)
	{
		int k;
		k=strlen(books[i].au);
		for(j=0;j<k;j++)
		{   
			if(books[i].au[j]=='A'+most)
			{ 
				printf("%d\n",books[i].id);
				break;
			}
		}
	}
	return 0;
}
void main()
{
	struct s
	{
		int a;
		char b[100];
		struct s *next;
	};
	struct s *p1,*p2,*head;
	int m,n,i,j,k,t,d[50],max;
	char c;
	scanf("%d",&n);
	p1=(struct s *)malloc(sizeof(struct s));
	p2=p1;
	head=p1;
	scanf("%d %s",&p1->a,p1->b);
	for(i=0;i<n-1;i++)
	{
		p1=(struct s *)malloc(sizeof(struct s));
		p2->next=p1;
		p2=p1;
		scanf("%d %s",&p1->a,p1->b);
	}
	p2->next=0;
	t=0;
	p1=p2=head;
	
	for(c='A';c<='Z';c++)
	{
		k=0;
		for(i=0;i<n;i++)
		{
			j=0;
			while(p1->b[j]!='\0')
			{
				if(c==p1->b[j])
					k++;
				j++;
			}
			p1=p1->next;
		
		}
		
		d[t]=k;
		
		t++;
		p1=head;
	}
	j=0;
	max=d[0];
	for(i=1;i<26;i++)
		if(d[i]>max)
		{
			max=d[i];
			j=i;
		}
	printf("%c\n",'A'+j);
	printf("%d\n",max);
	t='A'+j;
for(i=0;i<n;i++)
		{
			j=0;
			while(p1->b[j]!='\0')
			{
				if(t==p1->b[j])
					printf("%d\n",p1->a);
				j++;
			}
			p1=p1->next;
		
		}

}
void main()
{  
	int m,n,i,j,k,d,s;
	int a,b=0,c;
	int tt[1000],pp[1000],miao[26]={0};
	char kk[1000][30];
	char w;
	scanf("%d",&m);

	for(i=0;i<m;i++)
	{
        scanf("%d %s",&tt[i],kk[i]);
	}
    for(s=0,j=65;j<=90;j++,s++)
	{
         for(k=0;k<m;k++)
		 {
             for(d=0;kk[k][d]!='\0';d++)
			 {
				 if(kk[k][d]==j) miao[s]++;
			 }
		 }
	}
	for(a=0;a<26;a++)
	{
		if(miao[a]>b) {b=miao[a];c=a;}
	}
	printf("%c\n%d\n",c+65,b);
	w=(c+65);
	for(i=0;i<m;i++)
	{
		for(j=0;kk[i][j]!='\0';j++)
		{
			if(kk[i][j]==w) {printf("%d\n",tt[i]);break;}
		}
	}

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

int main()
{
    int n, i, a, max=0, alp[26]={0};
    char *j;

    scanf("%d", &n);
    for(i=0;i<n;i++)
    {
        scanf("%d %s", &book[i].num, book[i].author);
        int len=strlen(book[i].author);
        for(j=book[i].author;j<(book[i].author+len);j++)
        {
            int x=*j;
            ++*(alp+x-65);
            if(*(alp+x-65)>max)
            {
                max=*(alp+x-65);
                a=x;
            }
        }
    }

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

    for(i=0;i<n;i++)
    {
        int len=strlen(book[i].author);
        for(j=book[i].author;j<(book[i].author+len);j++)
        {
            if((int)*j==a)
                printf("%d\n", book[i].num);
        }
    }

    return 0;
}
struct Au{
	int num;
	int a[1000];
} au[26];
int main ()
{
	int i, n, buch, tn;
	char s[30];
	for(i=0; i<26; i++)
		au[i].num=0;
	scanf("%d", &n);
	while(n--) {
		scanf("%d%s", &buch, s);
		for (i=0; s[i]; i++) {
			tn=au[s[i]-'A'].num;
			au[s[i]-'A'].a[tn]=buch;
			au[s[i]-'A'].num++;
		}
	}
	int temp=0;
	for (i=1; i<26; i++)
		if (au[i].num>au[temp].num)
			temp=i;
	printf("%c\n%d\n", 'A'+temp, au[temp].num);
	for (i=0; i<au[temp].num; i++)
		printf("%d\n", au[temp].a[i]);
	return 0;
}