int t, a, flag, a1;
/*bool prime(int k)
{
	int j, sqrt_k;
	if (k == 2)
		return 1;
	else
	{
		sqrt_k = sqrt((double)k);
		for (j = 2; j <= sqrt_k; j++)
		{
			if (k % (int)j == 0)
				break;
		}
		if (j == sqrt_k + 1)
			return 1;
		else
			return 0;
	}
}
/*
void find(int m)
{
	int i;
	if (prime(m))
	{
		flag = 1;
		t++;
	//	cout << t << endl;
		return;
	}
	for (i = 2; i <= sqrt((double) m); i++)
	{
		if ((m % i == 0) && (a1 <= i))
		{
		//	cout << a1 << 2<< endl;
			//cout << i <<  " " << 1 <<endl;
			a1 = i;
			//if (!prime(m / i))
				t++;
		//	cout << t << endl;
			find(m / i);
		}
	}
	return;
}*/
void find(int m, int min)
{
	int i;
	//int a[];
	for (i = 2; i <= sqrt((double)m); i++)
	{
		if (m % i == 0)
		{
			if (i >= min)
			//if (a1 >= i)
			{
				t++;
		//	if (!/*((m / i > i) && */(prime(m / i)))
			//	cout << t << " ";
			//	cout <<i<<" " << m / i << " " << t <<endl;
			//	t++;
			//	cout << " " << a1 <<endl;
				//cout << t<<endl;
			//	a1 = i;
				min = i;
				//cout << min << endl;
				find(m / i, min);

			}

		}
	}
	/*if (i == (int)sqrt((double)m) - 1)
		return;*/
	return;
}
int main()
{
	int n, ii;
	cin >> n;
	for (ii = 1; ii <= n; ii++)
	{
		t = 0;
		flag = 0;
		cin >> a;
	//	if (prime(a)) t--;
		a1 = a;
		find(a, 2);
		cout << t + 1<< endl;
	}

	return 0;
}


int num;

int wrh(int n,int r,int b[200],int y,int a)
{
	int i;
    for( i = y;i <= a/2;i ++ )
	{
		if ( r % i == 0)
		{
			b[n] = i;
			int now = 1,j;
			for ( j = 1;j <= n;j ++ )
				now = now * b[j];
			if ( now == a)
			{
				num ++;
				break;
			}
			if ( now > a) break;
			else
				wrh(n + 1,r / i,b,i,a);
		}
	}
	return 0;
}

int main()
{

    int s,a,b[200];
	cin >> s;
	while (s > 0)
	{
		num = 0;
        cin >> a;
		wrh(1,a,b,2,a);
		cout << num + 1<<endl;
		s --;
	}
	return 0;
}


int prime(int min,int num)
{
	int i;
	for(i=min;i<num;i++)
	{
		if(num%i==0)
			return 0;
	}
 return 1;
}
int count(int min,int num)
{
	int i=0,n=1;
	if(prime(min,num))
		return 1;
	else
		for(i=min;i<num;i++)
		{
			if(num%i==0&&i<=num/i)
			{
				n=n+count(i,num/i);
			}
		}
	return n;
}
int main()
{
	int num,n,i;
	cin>>n;
	for(i=0;i<n;i++)
	{
		cin>>num;
		cout<<count(2,num)<<endl;
	}
	return 0;

}


int f(int num,int i)
{
	int sum;
	sum=0;
	int j;
		for(j=i;j<=num/2;j++)
		{
			if(num%j==0)
			{
				if(num/j<j)
				{
					sum=sum;
				}else{
					sum=1+sum+f(num/j,j);
				}
			}
		}
	return sum;
}
int main()
{
	int n,num,i;
	scanf("%d",&n);
	for(i=1;i<=n;i++)
	{
		scanf("%d",&num);
		int j,sum;
		sum=0;
		j=2;
	        	sum+=f(num,j);
		printf("%d\n",sum+1);
	}
	return 0;
}


int f(int a,int x)
{
	int i,j;
	if(x==2)
	return 1;

	else
	{
		int result=1;
		for(i=a;i<=x;i++)
		if(x%i==0&&x/i>=i)
		result=result+f(i,x/i);
		return result;
		}
}
main()
{
	int i,j,k;
	int n;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		int a;
		scanf("%d",&a);
		printf("%d\n",f(2,a));
		}
	}


//
//  main.cpp
//  ?????
//
//  Created by ???? on 13-11-22.
//  Copyright (c) 2013? ????. All rights reserved.
//

int f(int a,int s)//s for start
{
    if(a<=s) return 1;
	int b=sqrt((float)a),flag=0,sum=1;
	for(int i=s;i<=b;i++)
	{
		if(a%i==0)
		{
			flag++;

			sum=sum+f(a/i,i);
		}
	}
	if(flag==0) return 1;
	else return sum;
}

int main()
{
	int a,n;
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>a;
		cout<<f(a,2)<<endl;
	}

    return 0;
}


int sum=0;

void f(int x, int i)
{
	double m=sqrt(x);
	if(i<m)
	{
	if(x%i==0)
	{
		sum++;
		f(x/i,i);
	}
	f(x,i+1);
	}

	if(fabs(i-m)<0.00000001)
		sum++;

}

int main()
{
	int x,i,n;
	scanf("%d",&n);

	for(i=0;i<n;i++)
	{scanf("%d",&x);
	sum=0;
	f(x,2);

	printf("%d\n",sum+1);
	}
	return 0;

}


int f(int n, int min){
	int i, result=1;
	if(min>n)
		return 0;
	for(i=min;i<n;i++){
		if(n%i==0){
			result+=f(n/i,i);
		}
	}
	return result;
}

    int main(){
	int n,a,i,t;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&a);
		t=f(a,2);
		if(i<n-1)
			printf("%d\n",t);
		else
			printf("%d",t);

	}
	return 0;
	}


int number=0;
int main()
{
	void f(int first,int m);
	int n,i,num;
	cin>>n;
	for(i=0;i<n;i++)
	{
		cin>>num;
		f(2,num);
		cout<<number/2<<endl;
		number=0;
	}
	return 0;
}
void f(int first,int m)
{
	int i;
	for(i=first;i<=m;i++)
	{

		if(m%i==0)
		{
			m=m/i;
			f(i,m);
			if(m!=1)
			m=m*i;

		}
	}
	if(m==1)
		number+=1;
}


int c = 1;

void fenjie(int a, int k)
{
	if (a == 1)
	{
		c++;
		return;
	}
	for (int i = k; i <= a; i++)
	{
		if (a % i == 0)
		{
			fenjie(a / i, i);
		}
	}
}

int main()
{
	int n, a;
	cin >> n;
	while (n--)
	{
		c = 0;
		cin >> a;
		fenjie(a, 2);
		cout << c << endl;
	}
	return 0;
}


/*
 * 2.cpp
 *
 *  Created on: 2012-9-14
 *      Author: 12006
 */

int tmp = 2 ;
int suml(int n,int tmp)  //??????
{
	int sum = 0 ;
	if(n==1)
	{
		return 1 ;
	}
	for(int i = tmp ; i <=n ; i++)
	{
		if(n%i==0)
		{
			sum+=suml(n/i,i);

		}
	}
	return sum ;
}
int main()
{
	int m ;
	cin >> m ;
	int n ;
	for(int i = 0 ; i < m ; i++)
	{
		cin >> n ;
		int zon_shu = 0 ;
		zon_shu = suml(n,tmp) ;
		cout << zon_shu <<endl ;
	}
}


int main(){
  int hanshu(int k,int min);
  int n,i,a;
  scanf("%d",&n);
  for(i=0;i<n;i++){
      scanf("%d",&a);
      printf("%d\n",hanshu(a,2));
     }
  scanf("%d",&n);
  return 0;
}
  int hanshu(int k,int min){
      int j,a[k],b=1;
      if(k<min)return 0;
      for(j=min;j<=k/j;j++){
         if(k%j==0){
           b+=hanshu(k/j,j);
           }
         }
      return(b);
     }


int t;
void calc(int a,int d)
{
 int i;
 if (a==1) t++;
   else{
    if (a>=d)
      for (i=d;i<=a;i++)
	if (a%i==0)
	  calc(a/i,i);}
}
void main()
{
 int n,i,a;
 scanf("%d",&n);
 for (i=1;i<=n;i++)
   {
   scanf("%d",&a);
   t=0;
   calc(a,2);
   printf("%d\n",t);
   }
}


int factor(int a,int min){
    int i,result=1;
    if(a<min) return 0;
    for(i=min;i<a;i++){
                       if(a%i==0)
                       result+=factor(a/i,i);
                       }
    return result;
}

int main(){
    int n,i,a[100];
    scanf("%d",&n);
    for(i=0;i<n;i++){
                     scanf("%d",&a[i]);
                     a[i]=factor(a[i],2);
                     }
    for(i=0;i<n;i++){
                     if(i==n-1) printf("%d",a[i]);
                     else printf("%d\n",a[i]);
                     }
    return 0;
}


void factor(int,int);
int result[9999]={0};
int j=0;
int main()
{
	int times,k=1;
	cin>>times;
	while(k<=times){
	int num,ansf=0;
	cin>>num;
	factor(2,num);

	for(int i=0;i<9999;i++)
		if(result[i])ansf++;
	cout<<ansf<<endl;

	for(int i=0;i<9999;i++)
		result[i]=0;

	k++;
	}

	return 0;
}

void factor(int start,int num)
{
  if(num==1)
     {result[j]=1;j++;}

   for(int i=start;i<=num;i++){
	   if(num%i==0)
		   factor(i,num/i);
     }
}


int devide(int n,int m)
{
	if(n<m)
		m=n;
	if(n==1)//?????1?,??1
		return 1;
	int sum=0;
	for(int i=m;i>=2;i--)
	{
		if(n%i==0)
		{
			sum=sum+devide(n/i,i);
		}

	}
	return sum;
}

int main()
{
	int n,i,m;
	cin>>n;
	i=0;
	while ( i<n )
	{
		cin>>m;
		cout<<devide (m,m)<<endl;//???????
		i++;
	}
	return 0;

}


/*
 * 187.cpp
 *
 *  Created on: 2011-11-22
 *      Author: think
 */
int count(int a,int n){
	if(a>n)return 0;
	if(a==n)return 1;
	int p=1;
	int i;
	for(i=a;i<=n;i++){
		if(n%i==0&&i<=n/i){
			p=p+count(i,n/i);
		}
	}
	return p;
}
int geshu(int N){
	int i;
	int s=1;
	for(i=2;i<=sqrt(N);i++){
		if(N%i==0){
			s=s+count(i,N/i);
		}
	}

	return s;
}
int main(){
	int N;
	cin>>N;
	int c[N];
	int j;
	for(j=0;j<N;j++){
		cin>>c[j];
	}
	for(j=0;j<N;j++){
		cout<<geshu(c[j])<<endl;
	}
	return 0;
}


int breakways(int num, int min);
int main()
{
	int n;
	cin >> n;
	int number;
	for (int i = 1; i <= n ; i++)
	{
		cin >> number;
		cout << breakways(number , 2) << endl;
	}
}

int breakways(int num, int min)
{
	int sum = 0;
	for (int j = min ;j <= num ; j++)
	{
		if (num % j == 0)
		{
			if (num != j)
				sum += breakways (num / j , j);
			else
				sum += 1;
		}
	}
	return sum;
}


int sum=0;
void f(int n,int i)
{
    if(n==1) sum++;
    while(i<=n)
    {
        if(n%i==0) f(n/i,i);
        i++;
    }
    return ;
}
int main()
{

    int t=0;
    cin>>t;
    while(t--)
    {
        int n=0;
        cin>>n;
        int i=2,result=1;

       for (i=2;i<=n/2;i++) {
            if(n%i==0)
            {
                sum=0;
                f(n/i,i);
                result=result+sum;
            }

        }
        cout<<result<<endl;
    }
    return 0;
}


int sum;

void f(int x,int i){
     if(x == 1) sum++;
     else{
          for(;i <= x;i++)
                  if(x%i == 0) f(x/i,i);

          }

}

int main(){
    int n;
    cin>>n;
    while(n>0){

          int x = 0,i,ans = 1;
          cin>>x;
          for(i = 2;i*i < x;i++){
                if( x%i == 0) {
                    sum = 0;
                    f(x/i,i);
                    ans+=sum;
                    }
                }
          cout<<ans<<endl;
          n--;
}

    return 0;
    }


//????

int f(int x,int min){
	if(x<min) return 0;
	int r=1;
	for(int i=min;i<x/2;i++){
		if(x%i==0){
			r+=f(x/i,i);
		}
	}
	return r;
}

int main(){
	int n;
	cin>>n;
	while(n--){
		int x;
		cin>>x;
		cout<<f(x,2)<<endl;
	}
}


int DFS(int ,int );
int main()
{
	int q;
	cin>>q;
	for(int i=0;i<q;i++)
	{
	int n;
	int h=0;
	cin>>n;
	cout<<DFS(n,n)<<endl;
	}

	return 0;
}
int DFS(int n,int p)
{
	int ans=0;
	if(n==1)return 1;
	for(int i=2;i<=p;i++)
	{
		if(n%i==0)
		{
			ans=ans+DFS(n/i,i);
		}
	}
	return ans;

}


int num;
main()
{
      void fenjie(int x,int qi);
      int n,k,a;
      scanf("%d",&n);
      for(k=1;k<=n;k++)
      {
          num=0;
          scanf("%d",&a);
          fenjie(a,2);
          printf("%d\n",num);
      }
}
void fenjie(int x,int qi)
{
      if(x==1) num++;
      else
      {
         for(int i=qi;i<=x;i++)
         {
              if(x%i==0) fenjie(x/i,i);
         }
      }
}


int cal(int M, int N)
{
    int i;
	int num=0;
	if(M==1) return 0;
	if(N>=M) return ( 1+cal(M,M-1));
	for(i=2;i<M;i++)
	{
		if(M%i==0&&i<=N) num=num+cal(M/i,i);
	}
	return num;
}
int main()
{
	int n,M;
	cin>>n;
	while(n--)
	{
		cin>>M;
		cout<<cal(M,M)<<endl;
	}
	return 0;
}


int main()
{
  int i,j,num[100],n,m;
  int fj(int ,int );
  scanf("%d",&n);
  for(i=1;i<=n;i++)
   scanf("%d",&num[i]);
  for(i=1;i<=n;i++)
   printf("%d\n",fj(2,num[i]));

  return 0;
}

 int fj(int k,int n)
{
  int c,i,sum=1;
  if(n==2) return(sum);
  else if(n==3)  return(sum);
  else
   {
     c=(int)sqrt(n);
     for(i=k;i<=c;i++)
        if(n%i==0) sum=sum+fj(i,n/i);
     return(sum);
    }
}


int main()
{
	int fenjie(int m,int i);
	int n,i,c[100];
	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d",&c[i]);
	for(i=0;i<n;i++)
		printf("%d\n",fenjie(c[i],2));

	return 0;
}

int fenjie(int m,int i)
{
 int l = 1,j;
 int t = sqrt((float)m);
 for (j = i; j <= t; ++j)
 {
  if (m % j == 0)
   l += fenjie(m/j, j);
 }
  return l;
}


int factor(int a,int b){
        int i,ways;
        ways=1;
        if(a<b)
            return 0;
        for(i=b;i<=sqrt(a);i++){
            if(a%i==0)
                ways+=factor(a/i,i);
        }
        return ways;
    }

int main(){
    int n,A[99],K[99],i;
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%d",&A[i]);
        K[i]=factor(A[i],2);
    }
    for(i=0;i<n;i++){
        printf("%d\n",K[i]);
    }

    return 0;
    }


int check(int n,int i)
{
	for(i=2; i<=n/2;i++)
		if(n%i==0)
            break;
	return (i==n/2&&n!=4)?1:0;
}
int f(int n, int k)
{
	if (check(n,2)==1 || k==n)
		return 1;
	else if(n<k)
		return 0;
	else
	{
		int h=0,i;
		for( i=k;i<=sqrt(n);i++)
			if(n%i==0)
				h+=f(n/i,i);
		return h+1;
	}
}

void main()
{
	int n,h,i;
    scanf("%d",&n);
	for(i=0;i<n;i++)
    {
        scanf("%d",&h);
        printf("%d\n",f(h, 2));
    }
}


int yinshu(int be,int by)
{
    int i,sum=0;//cout<<be<<' '<<by<<endl;
    for(i=by;i*i<=be;i++)
    {
                       if(be%i==0){sum+=1+yinshu(be/i,i);}
    }
    return sum;
}
int main()
{
    int n,i,j,num,sign
    ;
    cin>>n;
    for(i=0;i<n;i++)
    {
                    cin>>num;for(j=num;j>1;j--)if(num%j==0)sign=j;
                    cout<<yinshu(num,sign)+1<<endl;
    }
    getchar();getchar();
    return 0;
}


int fenjie(int a,int b)
{
    int c=1,i;
    for(i=b;i<=(int)sqrt(a);i++)
    {
                                if(a%i==0)
                                c+=fenjie(a/i,i);
                                }
    return c;
}
main()
{
      int n,i,a,c;
      scanf("%d",&n);
      for(i=1;i<=n;i++)
      {
                       scanf("%d",&a);
                       c=fenjie(a,2);
                       printf("%d\n",c);
                       }
      }


int fenj(int x, int y) {
  int a=(x==1),i;
  for (i=y;i<=x;i++)//???2?????????
	  if(x%i==0)a=a+fenj(x/i,i);//?????????
  return a;
}
int main(){
	int k;
	cin>>k;
	int a[k];
	for(int i=0;i<k;i++)cin>>a[i];
	for(int i=0;i<k;i++)cout<<fenj(a[i],2)<<endl;
	return 0;
}


int N, A;

int acSearch(int n, int i) {
	int ret = 0;

	if(n == 1) ret = 1;
	else for(; i <= n; ++ i)
		if(n%i == 0) ret += acSearch(n/i, i);

	return ret;
}

int main() {
	scanf("%d", &N);
	for(; N --;) {
		scanf("%d", &A);
		printf("%d\n", acSearch(A, 2));
	}
	return 0;
}


int num;
void f(int n,int i);

main ()
{
     int i,j,k,n,order,top;

     for (scanf("%d",&order);order>=1;order--)
     {
         scanf("%d",&n);
         num=0;
         top=(int)sqrt(n);
         for (i=1;i<=top;i++)
         {
             if (n%i==0)
             {
                num++;
//printf("n=%d i=%d top=%d\n",n,i,top);
                f(n/i,i);
             }
         }
         printf("%d\n",num);
     }
}

void f(int n,int btm)
{
     if (btm==1) return;
     int top,i;
     top=(int)sqrt(n);
//printf("f:n=%d i=%d top=%d\n",n,i,top);
     if (top>=btm)
     {
         for (i=btm;i<=top;i++)
         {
//printf("f:n=%d i=%d top=%d\n",n,i,top);
             if (n%i==0)
             {
                num++;
                f(n/i,i);
             }
         }
     }
}


int s=0,p=1;
void fenjie(int a,int b)
{
	int i;
	if(a==1)
		s++;
	for(i=b;i<=a;i++)
		if(a%i==0) fenjie(a/i,i);
	return;
}
int main()
{
	int n,i,j,a[100];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
		for(j=2;j*j<=a[i];j++)
		{
			if(a[i]%j==0)
			{
				s=0;
				fenjie(a[i]/j,j);
				p=p+s;
			}
		}
        printf("%d\n",p);
		p=1;
	}
	return 0;
}


int f(int shu,int min)
{
  int k=1;
  if(shu < min)
  {
    k= 0;
   return k;
  }
  else
 {
  for(int i = min;i<shu;i++)
  {
    if(shu%i == 0)
    {
         k=k+ f(shu/i,i);
    }

  }
    return k;
}
}

main()
{
      int n,i,a;
      scanf("%d",&n);

      for(i=0;i<n;i++)
      {
          scanf("%d",&a);

          if(i!=n-1)
           printf("%d\n",f(a,2));
           else
           printf("%d",f(a,2));

      }

                      }


const int mov[4][2] = {{-1, 0}, {0, -1}, {1, 0}, {0, 1}};

int m, n, counter;

void dfs(int m, int i) {
	//cout << m << ' ' << n << endl;
	if (m == 1) {
		++counter;
		return;
	}
	for (;i <= m; ++i) {
		if (m % i == 0) {
			dfs(m/i, i);
		}
	}
}

int main() {
	int t, m, n;
	cin >> t;
	while (t--) {
		counter = 0;
		cin >> m;
		dfs(m, 2);
		cout << counter << endl;
	}
}


int f(int a,int min)//???a???????min?????????
{
	int i;
	if(a < min)//??????
	{
      return 0;
    }
    int result = 1;
    for(int i = min;i<a;i++)//??????
	{
    if(a % i == 0)
	{
      result += f(a/i,i);
    }
    }
    return result;
}
int main()
{
	int n,a;//????
	cin>>n;
	while(cin>>a)//????
	{
		cout<<f(a,2)<<endl;//????
	}
	return 0;
}


int  cal(int y,int x)
{
   int i,sum;
   if (x==1) return 1;
   else
   {
      sum=0;
      for (i=y;i<=x;i++)
      {
      if ((x%i==0)&&((x/i==1)||(x/i>y))) sum+=cal(i,x/i);

      }
      return sum;
   }
}
int main()
{
    int n,i,l;
    scanf("%d",&n);
    for (i=1;i<=n;i++)
    {
     scanf("%d",&l);
    printf("%d",cal(2,l));
    if (i!=n) printf("\n");
    }

    return 0;
}


int decomposition(int m,int k){
    int res=1;
    for(int i=k;i*i<=m;i++){
        if(m%i==0&&m/i>=i){

            res+=decomposition(m/i,i);
        }
    }
    return res;
}
int main(){
    int n;
    while(scanf("%d",&n)==1){
        for(int i=0;i<n;i++){
            int m;
            scanf("%d",&m);
            printf("%d\n",decomposition(m,2));
        }
    }
    return 0;
}


int f(int a,int min)
{
  if(a < min)
  {
    return 0;
  }

  int r= 1;
  for(int i = min;i<a;i++)
  {
    if(a%i == 0)
    {
         r+= f(a/i,i);
    }
  }

    return r;
}

main()
{
      int n,a,i,j=0,k,m=0,r=0;
      scanf("%d",&n);

      for(k=0;k<n;k++)
      {
          scanf("%d",&a);

          if(k!=n-1)
           printf("%d\n",f(a,2));
           else
           printf("%d",f(a,2));

      }

                      }


int a=1;
int yinzi(int j,int  n)
{
    for(int i=j;i<n;i++)
	{
		if(n%i==0&&n!=i&&n/i>=i)
			{
			    a++;
				yinzi(i,n/i);
			}

	}
	return 0;

}
int main()
{
	int n,s;
	cin>>s;
	for(int j=0;j<s;j++)
	{
		cin>>n;
		for(int i=2;i<=n;i++)
		{
			if(n%i==0&&n/i>=i)
			{
				a++;
		         yinzi(i,n/i);
			}
		}
	    cout<<a<<endl;
	    a=1;
	}
	return 0;
}


int sum=1;
void f(int i,int j)
{
	int k;
	if(i==1)
	    sum++;
	else
	{
		for(k=j;k<=i;k++)
		{
			if(i%k==0)
				f(i/k,k);
		}
	}
}
int main(void)
{
	int i,j,k;
	int n;
	int a;
	scanf("%d",&n);
	while(n--)
	{
		sum=1;
		scanf("%d",&a);
		for(i=2;i*i<=a;i++)
		{
			if(a%i==0)
			{
				f(a/i,i);
			}
		}
		printf("%d\n",sum);
	}
	return 0;
}


int main()
{
    int f(int a,int b);
    int n,m,i,d;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
                    scanf("%d",&m);
                    d=f(m,2);
                    printf("%d\n",d);
                    }
                    return 0;
                    }

    int f(int a,int b)
    {
        int t=1,k,j;
        for(j=b;j<a;j++)
        {
                        if(a%j==0&&a/j>=j)
                        k=f(a/j,j);
                        else
                        k=0;
                        t=t+k;
                        }
                        return t;
                        }


int a;
int m=0,s=1;
void temp(int b,int k,int c)
{
	for(int i=k;i<=b;i++)//????
	{

		if(b%i==0)
		{
			b=b/i;
			s=s*i;
			k=i;
			if(s==c)
			{
				m++;

			}
			else

				temp(b,k,c);
				s=s/i;//??
				b=b*i;

		}
	}
}
int main()
{
	int n,a,i;
	cin>>n;
	for(i=0;i<n;i++)
	{
		cin>>a;
		temp(a,2,a);//??
		cout<<m<<endl;
		m=0;
	}

	return 0;
}


void main()
{
	int f(int x,int m);
	int k,i,j,n,sum=0;
	scanf("%d",&n);
	for(i=1;i<=n;i++)
	{
		scanf("%d",&k);
		for(j=2;j<=k;j++)
		{
			if(k%j==0)
			{
				sum+=f(k,j);
			}
		}
		printf("%d\n",sum);
		sum=0;
	}
}

int f(int x,int m)
{
	int i,sum=0;
	if(m==x)
		sum=1;
	else
	{
		x=x/m;
		for(i=m;i<=x;i++)
		{
			if(x%i==0)
			{
				sum+=f(x,i);
			}
		}
	}
	return sum;
}


int meide(int x,int y)
{
	int sum=1,count=0,i;
	for(i=y;i<=sqrt(x);i++)
	{
		if(x%i==0)
		{
			sum=sum+meide(x/i,i);
		}
	}
	return sum;
}
int main()
{
	int k,n,m;
	scanf("%d",&k);
	for(m=0;m<k;m++)
	{
		scanf("%d",&n);
		if(n>=3)
		{
		    printf("%d\n",meide(n,2));
		}
	    else
		{
		    printf("1\n");
		}
	}
	return 0;
}


int s=0,p;
int a[100];
void factor(int m,int n,int t){
	int i;
	for(i=2;i<=(int)sqrt(n);i++)
		if((n%i==0)&&(i>=m)){
			s++;
			factor(i,n/i,t+1);
		}
	return;
}
int main(){
	int i,j=0,k;
	scanf("%d",&j);
	for(k=0;k<j;k++)
		scanf("%d",&a[k]);
	for(k=0;k<j;k++){
		p=a[k]; s=0;
	for(i=2;i<=(int)sqrt(p);i++)
		if(p%i==0){
		s++;
		factor(i,p/i,2);
		}
		a[k]=s;
	}
	for(k=0;k<j;k++)
		printf("%d\n",a[k]+1);
	return 0;
}


/*
 * ????apple.cpp
 * ???00948343_??
 * ?????2012/11/19
 * ???????
 */

int fenjie(int a, int start);

int main(){
	int n, i, integ;
	cin >> n;
	for (i=0;i<n;i++){
		cin >> integ;
		cout << fenjie(integ, 2) << endl;
	}
	return 0;
}

int fenjie(int a, int start){
	int i, sum=1;
	if (start==a)
		sum=1;
	else{
		for (i=start;i<=sqrt(a);i++){
			if (a%i==0){
				sum = sum + fenjie(a/i, i);
			}
		}
	}
	return sum;
}


// ????2.cpp : ??????????????
//

void out( int,int );

int t = 1;

int main()
{
	int n = 0;
	int i = 0;
	double sum = 0;
	cin >> n;

	for( i = 1;i <= n;i++ )
	{
		cin >> sum;
		out(sum,2.0);
		cout << t << endl;
		t = 1;
	}

	cin >> i;

	return 0;
}

void out(int sum,int q )
{
		int num = 0;
		double m = sum;
		num = sqrt(m);
		if( sum % q == 0 && q <= num )
		{
			t++;
			out( sum / q,q );
			out( sum,q + 1 );
		}
		if( sum % q != 0 && q <= num )
			out( sum,q + 1);
}


int main()
{
	int depart (int number, int y);

	int i, n, number;
	cin >> n;
	for (i = 1; i <= n; i++)
	{
		cin >> number;
		cout << depart (number, 2) << endl;
	}

	return 0;
}

int depart (int number, int y)
{
	int count = 1, a, i;
	if (number == 1)
		return 0;
	if (number == 2)
		return 1;
	else
	a = sqrt( number);
	for (i = y; i <= a; i++)
		if (number % i == 0)
			count += depart (number / i, i);
	return count;
}


int f(int n,int i)
{
    int sum=0;
    for(i;i<=(int)sqrt(n);i++){
        if(n%i==0) {
            sum+=f(n/i,i);
        }
    }
    return sum+1;
}
main()
{
      int i0,n0;
      scanf("%d",&n0);
      for(i0=0;i0<n0;i0++){
          int n;
          scanf("%d",&n);
          printf("%d\n",f(n,2));
      }
}


void find(int m,int j,int *p)
{
    for(;j<=m;j++)
    {
                  if(m==j)
                  {
                          (*p)++;
                          break;
                  }
                  if(m%j==0) find(m/j,j,p);
    }
}
int main()
{
    int n,m,i,j;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
                    int count=0;
                    int *p;
                    p=&count;
                    scanf("%d",&m);
                    find(m,2,p);
                    printf("%d\n",count);
    }

    return 0;
}


int f(int a,int b)
{
	if(a < b)
		return 0;
	int i,r =1 ;
	for(i = b; i <= a; i++ )
	{
		if( !(a%i) && i <= a/i )
		{
			r += f(a/i,i);
		}
	}
	return r;
}
void main()
{
	int n,m;
	scanf("%d",&n);
	while(n--)
	{
		scanf("%d",&m);
		int result = f(m,2);
		printf("%d\n",result);
	}
}


int s(int a,int b)
{  int sum=0,z=0;
	if(a!=1&&b<=a)
	{
	  for(int i=b;i<=a;++i)
   {
	   if(a%i==0)
	   {
		   sum+=s(a/i,i);z=1;
	   }
   }

	}
	else if(a==1)
		return 1;

	return sum;

}
int main()
{
	int n,a;
	cin>>n;
	for(int i=0;i<n;++i)
	{
		cin>>a;
		cout<<s(a,2)<<endl;
	}
	return 0;
}


void main()
{

	int f(int ,int );
	int n[100],sum,i,m;
	scanf("%d",&m);
	for(i=0;i<m;i++)
	scanf("%d",&n[i]);
	for(i=0;i<m;i++)
	{
		sum=f(1,n[i])+1;
	printf("%d\n",sum);
	}

}

int f(int i,int n)
{
	int j,k,sum=0;
	for(j=i;j<(int)sqrt((double)n)+1;j++)
	{

		k=sum;
		if(j==1)sum=0;
	    else
		{
			if(n%j==0&&n/j>=j)
		{
			sum=f(j,n/j)+1;
		}
			else sum=0;
		}
		sum=sum+k;

	}
	return(sum);
}


int f(int N, int min)
{
	int s=1, i;
	if(N < min)
		return 0;
	for(i = min; i < N; i++ )
	{
		if(N%i==0)
		{
			s += f(N/i, i);
		}
	}
	return s;
}

int main()
{
	int n, i, b = 2;
	int a[100];
	scanf("%d", &n);
	for(i = 0; i < n; i++)
		scanf("%d", &a[i]);
	for(i = 0; i < n; i++)
		printf("%d\n", f(a[i], b));
	return 0;
}


int times=1;
int used[1000]={0};
void fuck(int n)
{

	int i=0;
	for (i=2;i<=sqrt(n);i++)
	{
		if (used[i]==0&&n%i==0)
		{
			int j=0;
			for (j=0;j<=i-1;j++)
				used[j]=1;
			times++;
			fuck(n/i);
			for (j=0;j<=i-1;j++)
				used[j]=0;
		}
	}
}
int main()
{
	int n=0;
	int num=0;
	cin>>n;
	int i=0;
	for (i=0;i<n;i++)
	{
	cin>>num;
	fuck(num);
	cout<<times<<endl;
	times=1;
	int k=0;
	for (k=0;k<=999;k++)
	used[k]=0;
	}
	return 0;
}


/*
 * wanyi.cpp
 *
 *  Created on: 2012-11-20
 *      Author: 7
 */
int t=1;
void fen(int n,int i)
{
	for(i=i;i*i<=n;i++)
	{
		if(n%i==0)
		{
			fen(n/i,i);
			t++;
		}
	}
}
int main()
{
	int k;
	cin>>k;
	while(k--)
	{
		int n;
		cin>>n;
		t=1;
		fen(n,2);
		cout<<t<<endl;
	}
}


int dfs(int k, int b) {
  int ret=(k==1),i;
  for (i=b;i<=k;i++)
	  if (k%i==0)
		  ret+=dfs(k/i,i);
  return ret;
}
int main() {
	int n, k;
	cin>>n;
	for (int i=1;i<=n;i++) {

		cin>>k;
		cout<<dfs(k,2)<<endl;
	}
	return 0;
}


int sum=0;
void divide(int n,int a)
{
	for(int i=a;i<=n;i++)
	{
		if((n%i==0))
		{
			if(n/i==1)
				sum++;
			else
				divide(n/i,i);
		}
	}
}
int main()
{
	int N=0,n=0,i=0;
	cin>>N;
	for(i=0;i<N;i++)
	{
		cin>>n;
		divide(n,2);
		cout<<sum<<endl;
		sum=0;
	}
	return 0;
}


int m,n,num;

void dfs(int i,int j)
{
	int x;

	if (i==1)
	{
		num++;
		return;
	}
	for (x=j;x<=i;x++)
		if (i%x==0)
        dfs(i/x,x);
}

int main()
{
    cin>>m;
    while(m>0){
        num=0;
        cin>>n;
	dfs(n,2);
        cout<<num<<endl;
	m--;
     }
}


int fenjie(int a,int b)
{
	int i,sign=0,k=0;
	if(a<b) return 0;
	else if(a==b) return 1;
	else
	{
		for(i=2;i<=a-1;i++)
		{
			if(a%i==0)
				sign=1;
		}
		if(sign!=1) return 1;
		else
		{
			for(i=b;i<=a;i++)
			{
				if(a%i==0)
					k+=fenjie(a/i,i);
			}
			k+=1;
			return k;
		}
	}
}

int main()
{
	int n,a[100],i,k;
	scanf("%d",&n);

	for(i=1;i<=n;i++)
	{

		scanf("%d",&k);
		printf("%d\n",fenjie(k,2));
	}
	return 0;
}


int count(int x,int y)//?????????
{
    if(x<y) return 0;//????
    if(x>=y)
    {
      int sum=0;
      for(int j=y;j<x;j++)
      {
        if(x%j==0)
        sum=sum+count(x/j,j);//???
      }
      return sum+1;
    }
}
int main()
{
    int n;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++)
    cin>>a[i];
    for(int i=0;i<n;i++)
    cout<< count(a[i],2) <<endl;
    return 0;
}


int sum=0;
int geshu(int a,int x)
{
	int y,z;
	z=a;
	y=(int)sqrt(a);
	while(x<=y)
	{
		if(a%x==0)
		{
			a=a/x;
			geshu(a,x);
		}
		if(a==z/x)
			a=z;
		x++;
	}
	sum++;
	return sum;
}
int main()
{
	int n,i,a[100],b[100],x;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
		if(a[i]==2||a[i]==3)
			b[i]=1;
		else
		{
			sum=0;
			x=2;
			b[i]=geshu(a[i],x);
		}
	}
	for(i=0;i<n;i++)
	{
		printf("%d\n",b[i]);
	}
}


int fun(int i,int j,int count)
{
	int k;
	for (k=i;k<=sqrt(j);k++)
		if(j%k==0)
		{
			count++;
			count=fun(k,j/k,count);
		}
  return count;
}

int main()
{int count;
	int k,n,i,j;
	scanf("%d",&k);
	for(j=0;j<k;j++)
	{
		scanf("%d",&n);
		count=1;
	    for(i=2;i<sqrt(n);i++)
		   if(n%i==0)
		   {
			count++;
			count=fun(i,n/i,count);
		   }

     	printf("%d\n",count);
	}
	return 0;
}


int factor(int n,int min)
{
	int result=1, i ;

	if( n < min )
	{
		return 0;
	}

	for(i = min; i < n; i++)
	{
		if( n % i == 0 )
		{
		   result += factor( n/i,i );
		}
	}

	return result ;
}
int main()
{
	int m,x,j,k;

	scanf ( "%d", &m );

	for( j = 1;j <= m; j++ )
	{
		scanf ( "%d", &x );

		k = factor ( x, 2);

		printf ( "%d\n", k);
	}

	return 0;
}


int divide(int n,int j)
{
	int sum=1,i,s,p,k;
	s=sqrt(n);
	for(i=j;i<=s;i++)
	{
		if (n%i==0)
		{
			p=n/i;
            k=i;
			sum=sum+divide(p,i);
		}
	}
	return sum;
}
int main()
{
	int n;
	cin>>n;
	int k,m,p;
	for(k=0;k<n;k++)
	{
		cin>>m;
		p=divide(m,2);
		cout<<p<<endl;
	}
	return 0;
}


int factorization(int num, int i);
int main()
{
	int n, i, num;
	cin >> n;
	for (i = 0; i < n; i++)
	{
		cin >> num;
		cout << factorization(num, 2) << endl;
	}
	return 0;
}

int factorization(int num, int i)
{
	int j, squ, sum = 1;
	squ = sqrt((double) num);
	for (j = i; j <= squ; j++)
	{
		if (num % j == 0)
			sum = sum + factorization(num / j, j);
	}
	return sum;
};


int f(int a,int min)
{
    int i,result;
    if(a<min)
        return 0;
    result=1;
    for(i=min;i<a;i++)
        if(a%i==0)
            result+=f(a/i,i);
    return result;
}
int main()
{
    int i,n,num[100];
    cin>>n;
    for(i=0;i<n;i++)
    {
        cin>>num[i];
        cout<<f(num[i],2)<<endl;
    }
    return 0;
}


int factor(int N, int min){
	int result=1, i;
	if(N<min)
	return 0;
	for(i=min;i<N;i++){
		if(N%i==0){
			result+=factor(N/i,i);
			}
		}
	return result;
	}
int main(){
	int n,m,j,re;
	scanf("%d",&n);
	for(j=0;j<n;j++){
		scanf("%d",&m);
		re=factor(m,2);
		printf("%d\n",re);
		}
	scanf("%d",&n);
	return 0;
	}


int Digui(int a,int min)
{
	int i,result=1;
	if(a<min)
	{
		return 0;
	}
	for(i=min;i<a;i++)
	{
		if(a%i==0)
		{
			result+=Digui(a/i,i);
		}
	}
	return(result);
}
int main()
{
	int a[1000],n,i;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
	}
	for(i=0;i<n;i++)
	{
		printf("%d\n",Digui(a[i],2));
	}
	return 0;
}


int function(int num,int k)
{
int j;
int m=0;
if(num>1)
{for(j=k;j<=num;j++)
{if(num%j==0)
{m=m+function(num/j,j);}

}
return m;
}
else
return 1;
}
int main()
{int i,j;
int n;
cin>>n;
int num[100];

for(i=0;i<n;i++)
{cin>>num[i];}

for(i=0;i<n;i++)
{cout<<function(num[i],2)<<endl;
}

return 0;
}


int sort(int, int, int);

int main()
{
	int t=0;
	cin>>t;
	int k=1;
	for (k=1;k<=t;k++)
	{
	int vacancy=0;
	int num=1;
	cin>>num;
	int i=1;
	int temp=num;
	for (i=2;i<=temp;i++)
	{
		while (temp%i==0)
		{
			vacancy=vacancy+1;
			temp=temp/i;

		}

	}
	cout<<sort(1,vacancy,num)<<endl;

	}
		return 0;
}

int sort(int start, int vacancy, int num)
{
	if (num<start)
		return 0;

	if (vacancy==1)
		return 1;

	int sum=0;
	int i=1;
	for (i=start;i<=num;i++)
	{
		if (num%i==0)
		{
			sum=sum+sort(i,vacancy-1,num/i);
		}
	}

	return sum;
}


int ys(int af,int bf)
{
	int s;
	if(af<bf)
	s=0;
	if(af==bf)
	s=1;
	if(af>bf)
	{
		s=1;
		for(int i=af/2;i>=bf;i--)
		{
			if(af%i == 0)
			{
			s+=ys(af/i,i);
			}
		}
	}
	return s;
}
int main()
{
	int n;
	cin >> n;
	int p;
	while(cin>>p)
	{
		cout << ys(p,2) << endl;
	}
	return 0;
}


int f(int t,int k)
{
    int u=1,i;
    if(t>2)
    {
    for(i=k;i<=sqrt(t);i++)
    {
        if(t%i==0)
        {
            u += f(t/i,i);
        }
    }
    return u;
    }
    else if(t==2)
    return 1;
    else if(t==1)
    return 0;
}
main()
{
      int i,n,t;
      scanf("%d",&n);
      for(i=0;i<n;i++)
      {
          scanf("%d",&t);
          printf("%d\n",f(t,2));
      }
}


int main()
{
	int f(int a,int min);
	int n,a[150],i,b;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
	}
	for(i=0;i<n;i++)
	{
		b=f(a[i],2);
		printf("%d\n",b);
	}
	return 0;
}

int f(int a,int min)
{
	int result=1,i;
	if(a < min)
	{
	return 0;
	}
	for(i = min;i<a;i++)
	{
		if(a % i == 0)
		{
		result += f(a/i,i);
		}
	}
	return result;
}


int temp=2,sum=0;
void dg(int x)
{
	for(int i=temp; i<=x; i++)
	{
		if(x%i==0)
		{
			temp=i;
			if(x/i==1)
			{
				sum++;
				temp=2;
			}
			else dg(x/i);
		}
	}
}
int main()
{
	int n;
	cin>>n;
	int x;
	for(int i=0;i<n;i++)
	{
		cin>>x;
		dg(x);
		cout<<sum<<endl;
		sum=0;
	}
	return 0;
}


int digui(int x,int min);
int main()
{
	int n,i,m,y;
	scanf("%d",&n);
	for(i=0;i<=n-1;i++)
	{
		scanf("%d",&m);
		y=digui(m,2);
		printf("%d\n",y);
	}
	return 0;
}
int digui(int x,int min)
{
	int i,result;
	result=1;
	if(x<min)
	{
		return 0;
	}
	for(i=min;i<=x-1;i++)
	{
		if(x%i==0)
		{
			result=result+digui(x/i,i);
		}
	}
	return result;
}


void main()
{

int PrimeElement(int n,int m);

int n,m,i,k,t;
m=2;
scanf("%d",&k);
for(i=0;i<k;i++)
{
	scanf("%d",&n);
	t=PrimeElement(n,m);
	printf("%d\n",t);
}
}

int PrimeElement(int n,int m)
{
int i,t;
t=0;
for (i=m;i <=sqrt((double)(n));i++)

{
	if (n % i == 0)
			t = t + PrimeElement(n / i, i);
}
t = t + 1;
return t;
}


int fuck(int n,int m)
{
    int i,cnt=1;
    if(m>=sqrt(n))
    {return 1;}
        for(i=m;i<=sqrt(n);i++)
        {
            if(n%i==0)
            {
                cnt+=fuck(n/i,i);
            }

        }
        return cnt;

}
int main()
{
    int t, n, k;
    cin>>t;
    for(k=1;k<=t;k++)
    {
        cin>>n;
        cout<<fuck(n,2)<<endl;
    }
    int x;cin>>x;
    return 0;

}


int count;
void f(int a ,int b)
{
	int j;
	if(a==1)
		count+=1;
	else
	{
		for(j=b;j<=a;j++)
		{
			if(a%j==0)
				f(a/j,j);
		}
	}
}
int main()
{
	int n,i,number;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		count=0;
		scanf("%d",&number);
		f(number,2);
		printf("%d\n",count);
	}
	return 0;
}


int sum(int a,int i)
{
	int ret=1;
	for(;i<=sqrt((float)a);i++)
	{
		if(a%i==0)
		{
			ret+=sum(a/i,i);
		}
	}
	return ret;
}
int main()
{
	int t,a,j;
	cin>>t;

	for(j=0;j<t;j++)
	{
		cin>>a;
		cout<<sum(a,2)<<endl;
	}
	return 0;
}


int f(int,int);
int main()
{
	int n,i,a,b[100];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&a);
		b[i]=f(a,2);
	}
	for(i=0;i<n;i++)
	{
		printf("%d\n",b[i]);
	}
	return 0;
}
int f(int x,int y)
{
	int j,sum=1;
	if(x<y)
		sum=0;
	else
	{
		for(j=y;j<x;j++)
		{
			if(x%j==0)
				sum=sum+f(x/j,j);
		}
	}
	return sum;
}


int t;//t???
void f(int n,int d)//n?????d???
{
	int i;
	if(n==1)//
		t++;
	else
	{
		for(i=d;i<=n;i++)
		{
			if(n%i==0)
			{
				f(n/i,i);
			}
		}
	}
}
int main()
{
	int number[100];
	int n,i;
	int result[100];
	cin>>n;
	for(i=0;i<n;i++)
	{
		cin>>number[i];
	}
	for(i=0;i<n;i++)
	{
		t=0;
		f(number[i],2);
		result[i]=t;
	}
	for(i=0;i<n;i++)
	{
		cout<<result[i]<<endl;
	}
	return 0;
}


int fen(int x,int y);

int main(){
	int n,i,m[500];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&m[i]);
		printf("%d\n",fen(m[i],2));
	}
	return 0;
}

int fen(int x,int y){
	int j,k;
	int result=1;
	if(x<y)
		return 0;
	for(j=y;j<x;j++)
	{
		if(x%j==0)
		result+=fen(x/j,j);
	}
	return result;
}


int f(int a,int b);
int main()
{
	int n,a,i;
	cin>>n;
	for(i=0;i<n;i++)
	{
		cin>>a;
		cout<<f(a,2)<<endl;
	}
	return 0;
}
int f(int x,int y)  //y?????
{
	int j,k,t=0,m=0;
	for(j=2;j<x;j++)
		if(x%j==0) t++;
		if(t==0) return 1; //?????,??1
		else
		{
			for(k=y;k<=(int)sqrt((double)x);k++)
				if(x%k==0) 	m=m+f(x/k,k);
			 return (m+1);
		}
}


int im(int n,int max)
{
    int s=0,i;
    if(n==1)
    return 1;
    for(i=max;i>1;i--)
    if(n%i==0)
    s+=im(n/i,i);
    return s;
}
int main()
{
    int i,n,t;
    scanf("%d%d",&n,&t);
    printf("%d",im(t,t));
    for(i=1;i<n;i++)
    {
                    scanf("%d",&t);
                    printf("\n%d",im(t,t));
    }
    //getch();
    return 0;
}


void decprime(int begain,int a);
int sum=1;
int main()
{
	int n,a;
	int k;cin>>n;
	for(k=0;k<n;k++){
		cin>>a;
		 decprime(2,a) ;
		 cout<<sum<<endl;
		 sum=1;
	}
	return 0;
}
void decprime(int begain,int a)
{
	int i;
	 //int u=int(sqrt(double(a)));
//int m[10000]={};

	//if(a==2||a==3||a==5)return 1;
	//else{
		for(i=begain;i<=a;i++){
		if(a%i==0&&i<=a/i)
		{
			sum++;
			decprime(i,a/i);
		}
		if(i>a/i)break;
			//m[i]=decprime(a/i);
		//else m[i]=0;
//sum+=m[i];
		//}
	 //return sum+1;
	 }
		}


/*
 * 1.cpp
 *
 *  Created on: 2010-12-1
 *      Author: ???
 *        ??? ????
 */

int g(int x,int j){
	for(j++;j<=x;j++){
		if(x==j)
			return 1;
		if(x%j==0&&x/j>=j)
			return g(x/j,j-1)+g(x,j);
	}
	return 0;
}

int main(){
	int n,a;
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>a;
		cout<<g(a,1)<<endl;
	}
	return 0;
}


void fenjie( int i , int a ) ;

int k = 1 ;

int main()
{
	int n , m , a ;

	cin >> n ;

	for( m = 1 ; m <= n ; m ++ )
	{
		cin >> a ;

		fenjie( 2 , a ) ;

		cout << k << endl ;

		k = 1 ;

	}

	return 0 ;
}

void fenjie( int i , int a )
{
	for( ; i <= sqrt( a ) ; i ++ )
		if( a % i == 0 )
		{
			k ++ ;

			fenjie( i , a / i ) ;
		}

}


int d;
int fen(int i,int a)
{
  if(i>a)
  {
   return 0;
  }
  int result=1;
  int j;
  for(j=i;j<a;j++)
  {
    if(a%j==0)
    {
      result=result+fen(j,a/j);
    }
  }
  return result;
}
int main()
{
  int n;
  cin >> n;
  int k=0;
  while(k<n)
  {

    int a;
    cin >> a;
    int i=2;
    d=fen(i,a);
    cout << d << endl;
    k++;
  }
  return 0;
  cin.get();cin.get();cin.get();
}


/**
 * author:liucheng
 * date:2010-10-23 13:04:16
 * file:factors.cpp
 */

int factor(int num,int minA1)
{
        int count=0;
        int sqrtNum;
        int i;

        if(num <= minA1)
                return 0;

        sqrtNum=(int)sqrt((double)num);
        for(i=minA1;i<=sqrtNum;i++)
                if(num % i == 0)
                {
                        count++;//num=i*(num/i)
                        count+=factor(num/i,i);//num=i*(factor(num/i))
                }

        return count;
}

int main()
{
        int n;
        int num;

        cin>>n;

        while(n -- )
        {
                cin>>num;
                cout<<factor(num,2)+1<<endl;
        }

        return 0;
}


int f(int m,int j);
int main()
{
    int n,m;
    cin>>n;
    for(int i=0;i<n;i++)
    {
        cin>>m;
        cout<<f(m,2)<<endl;
    }
    return 0;
}
int f(int m,int j)          //
{
    int num=1;
    for(int i=j;i<=sqrt(m);i++)
    {
        if(m%i==0)
        {
            num+=f(m/i,i);
        }
    }
    return num;
}


int division(int m,int k)
{
	int num=0;
	if(m>=k)
	{
		for(int i=k;i<=m;i++)
		{
			if(m==i) num++;
			else if(m%i==0)
			{
				num+=division(m/i,i);
			}
		}
	}
	return num;
}

int main()
{
	int n;
	cin>>n;
	for(int i=0;i<n;i++)
	{
		int a;
		cin>>a;
		cout<<division(a,2)<<endl;
	}
	return 0;
}


int function(int n,int a)
{
	int kind=0;
	int i;
	if(n==1)
	return 1;
	for(i=a;i<=n;i++)
	{
		if(n%i==0)
		{
			if(n/i<i&&i!=n);
			else
			{
				kind=kind+function(n/i,i);
			}
		}
	}
	return kind;
}

int main()
{
	int m,n,i,sum;
	cin>>m;
	for(i=1;i<=m;i++)
	{
		cin>>n;
		sum=function(n,2);
		cout<<sum<<endl;
	}
	return 0;
}


int num;
int dg(int m,int limit);

int main()
{
    int n;
    cin>>n;
    for (int i=1;i<=n;i++)
    {
        int m; cin>>m;
        num=0;
        dg(m,2);
        cout<<num<<endl;
    }
    return 0;
}
int dg(int m,int limit)
{
    for (int i=limit;i<=m/2;i++)
        if (m%i==0) dg(m/i,i);
    if (m>=limit) num++;
    return 0;
}


/*int hf[32768][32768]={0};
int work(int m,int n)
{
	if(hf[m][n]!=0)
	return hf[m][n];
	if(m%n!=0)
	{
		hf[m][n]=0;
		return 0;
	}
	for(int i=n;i<=m/n;i++)
	hf[m][n]+=work(m/n,i);
	return hf[m][n];
}*/
int work(int m,int n)
{
	if(m==n)
	return 1;
	if(m%n!=0)
	return 0;
	int sum=0;
	for(int i=n;i<=m/n;i++)
	sum+=work(m/n,i);
	return sum;
}
int main()
{
	int n,m,a;
	cin>>n;
	int i,j,k;
	for(i=1;i<=n;i++)
	{
		cin>>m;
		int s=0;
		for(j=2;j<=m;j++)
		s+=work(m,j);
		cout<<s<<endl;
	}
	return 0;
}


int tru(int c)
{
	int j,p=0;
	if(c==1||c==2)
		return 1;
	else for(j=2;j<=pow((double)c,0.5);j++)
		     if(c%j==0)
			 {
				 p=1;
				 break;
			 }
		  if(p==1) return 0;
		  else return 1;
}
int count(int a,int b)
{
	int i,k=1;
	if(!tru(a))
		for(i=b;i<=pow((double)a,0.5);i++)
			if(a%i==0)
				k=k+count(a/i,i);
	return k;
}
int main()
{
	int n,x[999],q;
	scanf("%d",&n);
	for(q=0;q<n;q++)
		scanf("%d",&x[q]);
	for(q=0;q<n;q++)
		printf("%d\n",count(x[q],2));

	return 0;
}


int x[1000]={0};
void f(int m,int n,int l)
{
	int i;
	for(i=m;i<=n;i++)
	{
		if(n%i!=0) continue;
		else
		{
			if(n/i==1)
			{
				x[l]++;
				return;
			}
			else f(i,n/i,l);
		}
	}
}

int main()
{
	int a[1000],s,j,sum;
	cin>>sum;
	for(j=1;j<=sum;j++)
	{
		cin>>a[j];
		s=2;
	    f(s,a[j],j);
	}
	for(j=1;j<=sum;j++)
	{
		cout<<x[j]<<endl;
	}
	return 0;
}


int numcount=0;
void divide(int num,int x)
{
	int i;
	if(num==1)
		numcount++;
	for(i=x;i<=num;i++)
	{
		if(num%i==0)
			divide(num/i,i);
	}
}

int main()
{
	int n,num,i;
	int first=2;
	int ans[100];
	cin>>n;
	for(i=1;i<=n;i++)
	{
		cin>>num;
		divide(num,first);
		ans[i]=numcount;
		//cout<<count<<endl;
		numcount=0;
	}
	for(i=1;i<=n;i++)
		cout<<ans[i]<<endl;
	return 0;
}


int shuliang(int m,int n);
main()
{
    int n;
    scanf("%d",&n);
    for (int i = 1;i <= n;i ++)
    {
        int x,q,answer=1;
        scanf("%d",&x);
        q=sqrt(x)+1;
        for (int j = 2; j < q; j ++)
        {
            if (x%j==0)
                answer+=shuliang(j,x/j);

        }
        printf("%d\n\n",answer);
    }
}

int shuliang(int m,int n)
{
    int q,answer=0,y=0;
    q=sqrt(n)+1;
    for (int j = m;j < q;j ++)
    {
        if (n%j==0)
            answer+=shuliang(j,n/j),y=1;
    }
    if(y==1)
        return answer+1;
    else
        return 1;
}


void main()
{
	int fac(int a,int b);
	int n,i,m,a[100];
	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d",&a[i]);
	for(i=0;i<n;i++)
	{
		m=fac(a[i],2);
		printf("%d\n",m);
	}
}

int fac(int a,int b)
{
	int j,i;
	if(a<b) j=0;
	else
	{
		j=1;
		for(i=b;i<a;i++)
		{
		if(a%i==0)  j=j+fac(a/i,i);

		}
	}
	return(j);
}


void main()
{
	int ways(int a, int min);
	int n,b;
	scanf("%d",&n);
	while(n-->0)
	{
		scanf("%d",&b);
		printf("%d\n",ways(b,2));
	}
}
int ways(int a, int min)
{
	if(a<min) return 0;
	int sum=0,i;
	for(i=min;i<=sqrt(a*1.0);i++)
	{
		if(a%i == 0)
			sum = sum + ways(a/i, i);
	}
	return sum+1;
}


int num(int b,int min);
int x=1,m;
int main()
{
	int a,n,b;
	scanf("%d",&n);
	for(a=0;a<=n-1;a++)
	{
        scanf("%d",&b);
		m=b;
		b=num(b,2);
		printf("%d\n",b);
		x=1;
	}
	return 0;
}

int num(int b,int min)
{
	int a,c;

	for(a=min;a<b;a++)
	{
		if((b%a==0)&&(b/a>=a))
		{
            if(num(b/a,a)==1)
			{
				x++;
			}
		}
		if(a==m-1) return x;
	}
	return 1;
}


int yinshu[10000];
int j=0;
int temp=0;
int main()
{
    void fenjie(int j,int sum);
    int t,n[10000],i;
    cin>>t;
    for(i=0;i<10000;i++)
    {
        yinshu[i]=0;
    }
    for(i=0;i<t;i++)
    {
        cin>>n[i];
    }
    for(i=0;i<t;i++)
    {
        fenjie(1,n[i]);
        cout<<temp<<endl;
        temp=0;
    }
    return 0;
}
void fenjie(int j,int sum)
{
    for(int i=2;i<=sum;i++)
    {
        if(sum%i==0&&yinshu[j-1]<=i)
        {
            yinshu[j]=i;
            if(sum==i)
            {
                temp++;
            }
            else
            {
                fenjie(j+1,sum/i);
            }
        }
    }
}


int sum = 0;
void f(int a,int s)
{
	int i;
	if(a == 1)
		sum++;
	else
	{

		for(i = s; i <= a; i++)
		{
			if(a % i == 0)
				f((a / i),i);
		}
	}
	return;
}

int main()
{
	int n, num, j;
	cin >> n;
	for (j = 1; j <= n; j++)
	{
		cin >> num;
		f(num,2);
		printf("%d\n",sum);
		sum = 0;

	}
	return 0;
}


int ys(int x,int min){
    int r=1;
    if(x<min)
    return 0;
    for(int i=min;i<x;i++){
            if(x%i==0)
              r+=ys(x/i,i);
            }
    return r;
}
int main(){
    int n,a[1000];
    scanf("%d",&n);
    for(int i=0;i<n;i++){
            scanf("%d",&a[i]);
            }
    for(int i=0;i<n;i++){
            printf("%d\n",ys(a[i],2));
            }
    return 0;
}


int t=0,ways;  //??????t?ways
void divide(int x,int h)
{
	int i;
	if(x==1)  //??x==1
	{t++;ways=t;}  //t+1?ways?????t
	else
		for(i=h;i<=x;i++)
			if(x%i==0)
				{h=i;
				divide(x/h,h);  //h?????????????divide?????????
				}
}
int main()
{
	int n;
	cin>>n;
	int a[n];
	for(int i=0;i<n;i++)
	{cin>>a[i];
	t=0;divide(a[i],2);
	cout<<ways<<endl;}
	return 0;
}


int fenjie(int n,int min)
{int i,a=0,x=0;
for(i=2;i<=n;i++)
if(n%i==0)
a=a+1;
	if(n==1)
	return 1;
	else
	{
		for(i=min;i<=n;i++)
		{
			if(n%i==0)
			x=x+fenjie(n/i,i);
		}
		return x;
	}
}
main()
{
	int t,j,num;
	scanf("%d",&t);
	for(j=1;j<=t;j++)
	{
		scanf("%d",&num);
		printf("%d\n",fenjie(num,2));}
}


int num = 1, i, factor;

void f(int factor, int x)
{
	for (; factor * factor <= x; factor++)
	{
		if (x % factor == 0)
		{
			num++;
			f(factor, x / factor);
		}
	}
}

int main()
{
	int a, n;
	cin >> n;
	while(n--)
	{
		cin >> a;
		f(2, a);
		cout << num << endl;
		num = 1;
	}

	return 0;
}


/*
 * part.cpp
 *
 *  Created on: 2012-11-25
 *      Author: Lsj
 */

int disintegerate(int a, int b)//?????a????
{
	if (a == b || b == 1)//a b????b=1??????
		return 1;
	if (a > b)//a??b?b???1????0???0
		return 0;
	int ans = 0;//ans???
	for (int i = a; i <= b; i++)//?a?b??
	{
		if (b % i == 0)//b??????
			ans = ans + disintegerate(i, b / i);//??????
	}
	return ans;//??ans
}

int main()//main??
{
	int Time;
	cin >> Time;//????
	while (Time > 0) {
		int n;
		cin >> n;//??n
		cout << disintegerate(2, n) << endl;//????
		Time--;//Time?1
	}

	return 0;
}//??


int Fz(int,int);
int main()
{
    int n,num[1000];
    cin>>n;
    for(int i=0;i<n;i++)
    {
        int a;
        cin>>a;
       num[i]=Fz(a,2);
    }
for(int i=0;i<n;i++){
	cout<<num[i]<<endl;
}
    return 0;
}
int Fz(int x,int m)
{
    int s=1,i;
    int y=(int)sqrt((double)x);
    for(i=m;i<=y;i++)
    {
        if(x%i==0)
        {
        s=s+Fz(x/i,i);
        }
    }
    return s;
}


int main(){
	int number(int n, int low);
	int n, i, data, ans;
	scanf("%d", &n);
	for (i=1; i<=n; i++)
	{
		scanf("%d", &data);
		ans = number(data, 2);
		printf("%d\n", ans);
	}
}
int number(int n, int low)
{
	int j, ans;
	ans = 0;
	for (j = low ; j * j<= n; j++)
	{
		if (n % j == 0)
			ans = ans + number(n / j, j);
	}
	ans = ans + 1;
	return ans;
}


struct wr
{ char w;
  int k;
  int num[1000];
  struct wr* next;
};

struct wr * creat(void)
{
	struct wr *head,*p1,*p2,a;
	char i;
	head=p2=(struct wr *)malloc(sizeof(struct wr));
	head->w='A';
	head->k=0;
	for(i='B';i<='Z';i++)
	{
		p1=(struct wr *)malloc(sizeof(struct wr));
        p1->w=i;
		p1->k=0;
		p2->next=p1;
		p2=p1;
	}
	p2->next=NULL;
	return head;
}

void add(char a,int b,struct wr * head)
{
	struct wr *p;
	for(p=head;p!=NULL;p=p->next)
	if(a==p->w)
	{(p->k)++;
	  *(p->num+p->k-1)=b;
	}
}

void max(struct wr * head)
{
	struct wr *p1,t;
	for(p1=head->next;p1!=NULL;p1=p1->next)
		 if(p1->k>head->k)
		 *head=*p1;
}

void main()
{
	struct wr *head,*t;
	int n,*no,i;
	char *ws,*p;
	ws=(char *)malloc(sizeof(char)*27);
	head=creat();
	scanf("%d",&n);
	for(i=1;i<=n;i++)
	{
		scanf("%d",&no);
		gets(ws);
		for(p=ws;*p!='\0';p++)
			add(*p,no,head);
	}
    max(head);
	printf("%c\n",head->w);
	printf("%d\n",head->k);
	for(i=0;i<head->k;i++)
		printf("%d\n",*(head->num+i));

}


struct score
{
	char id[10];
	char name[26];
}book[1000];
int main()
{
	int i,j,k,n,num,max=0;
	char maxname;
	scanf("%d",&num);
	for(i=0;i<num;i++){
		scanf("%s",book[i].id);
		scanf("%s",book[i].name);
	}
	for(i=0;i<26;i++){
		n=0;
		for(j=0;j<num;j++){
			for(k=0;k<26;k++){
				if(book[j].name[k]==('A'+i))n+=1;
			}
		}
		if(n>max){
			maxname='A'+i;
			max=n;
		}
	}
	printf("%c\n%d\n",maxname,max);
	for(j=0;j<num;j++){
		for(k=0;k<26;k++){
			if(book[j].name[k]==maxname)printf("%s\n",book[j].id);;
		}
	}
	return 0;
}


int main()
{
	int n;
	cin>>n;
	int a[26],max,num[n],i,j,s;
	char maxname,name[n][10];
	memset(a,0,sizeof(a));
	for(i=0;i<n;i++)
	{
		cin>>num[i]>>name[i];
		s=strlen(name[i]);
		for(j=0;j<s;j++)
			a[name[i][j]-'A']++;
	}
	max=a[0],maxname='A';
	for(i=1;i<26;i++)
		if(a[i]>max)
		{
			max=a[i],maxname='A'+i;
		}
	cout<<maxname<<endl<<max<<endl;
	for(i=0;i<n;i++)
	{
		s=strlen(name[i]);
		for(j=0;j<s;j++)
			if(name[i][j]==maxname)
				cout<<num[i]<<endl;
	}
	return 0;
}


int pro(char pr)
{
     return toupper(pr) - 'A';
}

void put_names(int name[26][100], int books[26], int booknum);
int max(int books[26]);

main()
{
      int n, i, name[26][100],  books[26] = {0}, max_ptr;
      int booknum;

      scanf("%d", &n);

      for(i = 1;i <= n;i ++)
      {
            scanf("%d", &booknum);
            put_names(name, books, booknum);

      }

      max_ptr = max(books);
      printf("%c\n", max_ptr + 'A');
      printf("%d\n", books[max_ptr]);

      for(i = 1;i <= books[max_ptr];i ++)
      {
            printf("%d\n", name[max_ptr][i]);
      }
}

void put_names(int name[26][100], int books[26], int booknum)
{
     char ch;
     int ptr;
     int counter = 0;
     while(1)
     {
             ch = getchar();
             if(ch != ' ') break;
     }

     while(1)
     {

               ptr = pro(ch);
               books[ptr] ++;
               //printf("|%c, %d|---", ch, books[ptr]);

               name[ptr][books[ptr]] = booknum;
               ch = getchar();
               if(ch == '\n') break;

     }
     //printf("[%d]\n", counter);
}

int max(int books[26])
{
    int i;
    int ptr;
    ptr = books[0];
    for(i = 0;i <= 25;i ++)
    {
          if(books[i] > books[ptr]) ptr = i;
    }
    return ptr;
}


struct book
{
	int code;
	char writer[10];
};
void main()
{
	int n,i,j,t=0,d,ww[27]={0};
	char max,w[27];
	struct book list[999];
	scanf("%d",&n);
	for(i=0;i<26;i++)w[i]=i+65;
	for(i=0;i<n;i++)
		scanf("%d %s",&list[i].code,list[i].writer);
   for(i=0;i<n;i++)
	   for(j=0;list[i].writer[j]!='\0';j++)
       {
		   for(d=0;d<26;d++)
			   if(list[i].writer[j]==w[d])ww[d]++;
	   }
	   max=ww[0];
	for(i=0;i<26;i++)
	if(ww[i]>max)
	{
		max=ww[i];
		t=i;
	}
	printf("%c\n%d\n",w[t],ww[t]);

for(i=0;i<n;i++)
	   for(j=0;list[i].writer[j]!='\0';j++)
       {

			   if(list[i].writer[j]==w[t])printf("%d\n",list[i].code);
	   }
}


struct worker
{
	int name;
	char au[20];
	struct worker *next;
};
struct help
{
	char author;
	int  max;
};
struct worker*creat(int m)
{
	struct worker*p1,*p2,*p;
	int i;
	p1=p2=(struct worker *)malloc(sizeof(struct worker));

	scanf("%d %s",&p1->name,p1->au);
	p=p1;
	for(i=0;i<m-1;i++)
	{
		p1=(struct worker *)malloc(sizeof(struct worker));
		scanf("%d %s",&p1->name,p1->au);
		p2->next=p1;
		p2=p1;
	}
	p2->next=NULL;
	return p;
}
void print(struct worker *p)
{
	struct worker *p1;
	p1=p;
	while(p1!=NULL)
	{
		printf("%d %s\n",p1->name,p1->au);
		p1=p1->next;
	}
}
void most(struct worker *p)
{
	struct worker *p1,*p2;
	int a[30]={0},i,max;
	char author;
	struct help t;
	p1=p;
	p2=p;
	while(p1!=NULL)
	{
		for(i=0;*(p1->au+i)!='\0';i++)
		{
			a[*(p1->au+i)-65]=a[*(p1->au+i)-65]+1;
		}
		p1=p1->next;
	}
	for(i=0,max=0;i<26;i++)
	{
		if(a[i]>max) max=a[i];
	}
	for(i=0;i<26;i++)
	{
		if(a[i]==max) author=i+65;
	}
	printf("%c\n%d\n",author,max);
    p1=p;
	while(p1!=NULL)
	{
		for(i=0;*(p1->au+i)!='\0';i++)
		{
			if(*(p1->au+i)==author) printf("%d\n",p1->name);
		}
		p1=p1->next;
	}
}
void main()
{
	struct worker *p1,*p;
	struct help t;
	int m;
	char c;
	scanf("%d",&m);
	p=creat(m);
	p1=p;
	//print(p1);
	most(p1);
}


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

int main()
{
	int n,i,j,max=0,m=0;
	scanf("%d",&n);
	int c[26]={0};
	for(i=0;i<n;i++)
	{
		scanf("%d %s",&book[i].num,book[i].name);
	}
	for(i=0;i<n;i++)
	{
		for(j=0;j<26;j++)
		{
			strchr(book[i].name,'A'+j)?c[j]++:0;
		}
	}
	for(j=0;j<26;j++)
	{
		if(c[j]>max)
		{
			max=c[j];
			m=j;
		}
	}
	printf("%c\n%d\n",'A'+m,c[m]);
	for(i=0;i<n;i++)
	{
		strchr(book[i].name,'A'+m)?printf("%d\n",book[i].num):0;
	}
	return 0;
}


void main()
{
	struct book
	{
		int x;
		char z[10];
		struct book *next;
	}*p1,*p2,*p,*head,*t;
	int i,n,max=0,j,k,l,y[400],q;char u;scanf("%d",&n);
p1=p2=head=(struct book *)malloc(sizeof(struct book));
for(i=0;i<n;i++)
{
	scanf("%d %s",&p1->x,p1->z);y[i]=strlen(p1->z);
	p1=(struct book *)malloc(sizeof(struct book));p2->next=p1;p2=p1;
}
p=head;
for(i=0;i<n-1;i++)
{
for(j=0;j<y[i];j++)
{
	q=1;t=p->next;
	for(k=i+1;k<n;k++)
	{
		for(l=0;l<y[k];l++)
			if(p->z[j]==t->z[l])q++;
			t=t->next;
	}
	if(q>max){max=q;u=p->z[j];}
}
p=p->next;
}
printf("%c\n%d\n",u,max);
p=head;
for(i=0;i<n;i++)
{
	for(j=0;j<y[i];j++)
		if(u==p->z[j]){printf("%d\n",p->x);break;}
		p=p->next;
}
}


struct book
{
	int num;
	char name[26];
};
struct name
{
	char na;
	int n;
};
void main()
{
	int n,i,j,k,s,max=0;
	struct book a[1000];
	struct name b[26];
	scanf("%d",&n);
	for(i=0;i<=n-1;i++)
	{
		scanf("%d%s",&a[i].num,a[i].name);
	}
	for(i=0;i<=25;i++)
	{
		b[i].na='A'+i;
		for(j=0,s=0;j<=n-1;j++)
		{
			for(k=0;k<=strlen(a[j].name)-1;k++)
			{
				if(b[i].na==a[j].name[k])
				{
					s++;
					break;
				}
			}
		}
		b[i].n=s;
	}
	for(i=0;i<=25;i++)
	{
		if(b[i].n>max)
		{
			max=b[i].n;
		}
	}

	for(i=0;i<=25;i++)
	{
		if(b[i].n==max)
		{
			printf("%c\n%d\n",b[i].na,b[i].n);
		for(j=0;j<=n-1;j++)
			{
				for(k=0;k<=strlen(a[j].name)-1;k++)
				{
					if(b[i].na==a[j].name[k])
					{
						printf("%d\n",a[j].num);
						break;
					}
				}
			}
		}
	}
}


struct book
{
	int num;
	char edit[26];
	struct book *next;
};
int m;
struct book *head,*p1,*p2;

struct book *creat(void)
{
	p1=(struct book*)malloc(len);
	scanf("%d %s",&p1->num,p1->edit);
	head=p1;
	p2=p1;
	m=m-1;
	do
	{
		p1=(struct book*)malloc(len);
        scanf("%d %s",&p1->num,p1->edit);
		p1->next=NULL;
		p2->next=p1;
		p2=p1;
		m=m-1;
	}while(m);
	return(head);
}

void main()
{
    int max=0,i=0,j,k[26]={0};
	struct book *head,*p;
    scanf("%d",&m);
	head=creat();
	for(p=head;p!=NULL;)
	{
		for(i=0;p->edit[i]!=0;i++)
			k[(p->edit[i])-65]+=1;
		p=p->next;
	}
    for(i=0;i<26;i++)
		if(k[i]>max) {max=k[i];j=i;}
	printf("%c\n%d\n",j+65,max);
    for(p=head;p!=NULL;)
	{
		for(i=0;p->edit[i]!=0;i++)
			if(p->edit[i]==j+65) printf("%d\n",p->num);
		p=p->next;
	}

}


int main()
{
	struct book
	{
		int No;
		char author[27];
		int yes;
		struct book *next;
	};
	struct book*head,*p;
	int m,i,*max;
	int *count;
	count=(int*)malloc(26*sizeof(int));
	for(i=0;i<26;i++)
		*(count+i)=0;

	p=(struct book*)malloc(sizeof(struct book));
	head=p;
	scanf("%d",&m);
	for(i=0;i<m;i++)
	{
		scanf("%d%s",&p->No,p->author);
		if(i==m-1) p->next=NULL;
		else p->next=(struct book*)malloc(sizeof(struct book));
		p=p->next;
	}

	p=head;
	while(p!=NULL)
	{
		char *point;
		point=p->author;
		while(*point!='\0')
		{
			(*(count+((*point)-65)))++;
			point++;
		}
		p=p->next;
	}

	max=count;
	for(i=0;i<26;i++)
		if(*(count+i)>*max) max=count+i;
	printf("%c\n",max-count+65);
	printf("%d\n",*max);

	p=head;
	while(p!=NULL)
	{
		char *point;
		point=p->author;
		while(*point!='\0')
		{
			if(*point==max-count+65) printf("%d\n",p->No);
			point++;
		}
		p=p->next;
	}
	return 0;
}


int main()
{   char p=0;
	int m,i,j,max[1000];
	struct book{
		int num;
		char s[27];
	} book[1000];
	memset(max,0,sizeof(max));
	scanf("%d",&m);
	for(i=0;i<m;i++)
	{scanf("%d%s",&book[i].num,book[i].s);}
    for(i=0;i<m;i++)
	{for(j=0;book[i].s[j];j++)
	{ if(++max[book[i].s[j]]>max[p])
	p=book[i].s[j];
	}}
	printf("%c\n%d\n",p,max[p]);
	for(i=0;i<m;i++)
	{if(strchr(book[i].s,p))
	printf("%d\n",book[i].num);}

		return 0;
}


struct book
	{int num;
	 char name[27];
     struct book *next;
	};
main()
{
	struct book *p1,*p2,*head=NULL;
    int i,j,n,m,k,a[26],max,first;
	scanf("%d",&m);

	for(i=0;i<m;i++)
	{
       p1=(struct book*)malloc(sizeof(struct book));
	   scanf("%d%s",&p1->num,p1->name);
	   if(i==0) head=p1;
	   else p2->next=p1;
	        p2=p1;
	}
	p2->next=NULL;
	p1=head;
	for(i=0;i<26;i++)
		a[i]=0;
	for(i=0;i<m;i++)
	{
		n=strlen(p1->name);
		for(j=0;j<n;j++)
		{k=p1->name[j]-'A';a[k]++;
		}
		p1=p1->next;
	}

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

	p1=head;
	for(i=0;i<m;i++)
	{
		n=strlen(p1->name);
		for(j=0;j<n;j++)
		{
			if(p1->name[j]=='A'+first) {printf("%d\n",p1->num);
			                            break;}
		}
	p1=p1->next;
	}
}


struct tushu
{
	int num;
	char name[20];
	struct tushu *next;
};
struct tushu *creat(int m)
{
	struct tushu *head,*p1,*p2;
	p1=p2=(struct tushu *)malloc(LEN);
	scanf("%d%s",&p1->num,p1->name);
	head=p1;
	int i;
	for(i=2;i<=m;i++)
	{
		p1=(struct tushu *)malloc(LEN);
        scanf("%d%s",&p1->num,p1->name);
		p2->next=p1;
		p2=p1;
	}
	p2->next=NULL;
	return(head);
}
int main()
{
	int m,num[26]={0},i,max;
	scanf("%d",&m);
	struct tushu *head,*p1;
	head=creat(m);
	char *x;
	for(i=0;i<26;i++)
	{
		p1=head;
		x=p1->name;
		while(p1!=NULL)
		{
			while(*x!='\0')
			{
				if(*x==(i+65))
					num[i]=num[i]+1;
				x=x+1;
			}
			p1=p1->next;
			x=p1->name;
		}
	}
	max=0;
	for(i=1;i<26;i++)
	{
		if(num[max]<num[i])
			max=i;
	}
	printf("%c\n",max+65);
	printf("%d\n",num[max]);
	p1=head;
	x=p1->name;
	while(p1!=NULL)
	{
		while(*x!='\0')
		{
			if(*x==(max+65))
			{
				printf("%d\n",p1->num);
				break;
			}
			x=x+1;
		}
		p1=p1->next;
		x=p1->name;
	}
	return 0;
}


struct book{
	int co;
	char A[26];
};

int main(){
	int m,i,k,max;
	int count[26];
	int *cc;
	scanf("%d",&m);
	struct book *bk=(struct book*)malloc(sizeof(struct book)*m);/*??????*/
	struct book *p;
	p=bk;
	for(i=0;i<m;i++,p++){
		scanf("%d %s",&(p->co),p->A);
	}
	cc=count;/*?? */
	memset(count,0,sizeof(count));/*????*/
	for(i=0;i<26;i++,cc++){
		p=bk;
		for (k=0;k<m;k++,p++)
		{
			if (strchr(p->A,'A'+i))
			{
				(*cc)++;
			}
		}/*??*/
	}
	max=0;
	for (i=0;i<26;i++)
	{
		if (count[i]>count[max])
		{
			max=i;
		}
	}
	printf("%c\n%d\n",'A'+max,count[max]);
	p=bk;
	for (i=0;i<m;i++,p++)
	{
		if (strchr(p->A,'A'+max))
		{
			printf("%d\n",p->co);
		}
	}
	free(bk);
	return 0;
}


struct author
{
	int number;
	char name[26];
}
author[999];

struct single
{

	char letter[1];
	int number;

}
single[26];

int main(int argc, char* argv[])
{
	int n, i, m, j, p, k, book[999];
	for(i=0;i<26;i++)
	{
		single[i].letter[0]=65+i;
		single[i].number=0;
	}
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d %s",&author[i].number,&author[i].name);
	}
	for(i=0;i<n;i++)
	{
		for(j=0;j<26;j++)
		{
			for(k=0;k<26;k++)
			{
				if(single[k].letter[0]==author[i].name[j])
					single[k].number++;
			}
		}
	}
	m=0;
	p=single[0].number;
	for(i=1;i<26;i++)
	{
		if(p<single[i].number)
		{
			p=single[i].number;
			m=i;
		}
	}
	k=0;
	for(i=0;i<n;i++)
	{
		for(j=0;j<26;j++)
		{
			if(author[i].name[j]==single[m].letter[0])
			{
				book[k]=author[i].number;
				k++;
			}
		}
	}
	printf("%c\n",single[m].letter[0]);
	printf("%d\n",k);
	for(i=0;i<k;i++)
	{
		printf("%d\n",book[i]);
	}
	return 0;
}


int main()
{
	int book[1000], m, i, j, k, length, max = 0, name[500] = {0};
	char writer[1000][26], name1;
	cin >> m;
	for (i = 0; i < m; i++)
		cin >> book[i] >> writer[i];
	for (k = 'A'; k <= 'Z'; k++)
	{
		for (i = 0; i < m; i++)
		{
			length = strlen(writer[i]);
			for (j = 0; j < length; j++)
				if (writer[i][j] == k)
					name[k]++;
		}
		if (name[k] > max)
		{
			max = name[k];
			name1 = k;
		}
	}
	cout << name1 << endl;
	cout << max << endl;
	for (i = 0; i <= m; i++)
	{
		length = strlen(writer[i]);
		for (j = 0; j <= length; j++)
			if (writer[i][j] == name1)
				cout << book[i] << endl;
	}

	return 0;
}


int main()
{
	int record[26][1000];
	memset(record,0,sizeof(record));
	char name[10];
	int m,temp;
	cin>>m;
	for (int i=0;i<m;i++)
	{
		cin>>temp;
		cin.get();
		cin.getline(name,10);
		for (int i=0;i<strlen(name);i++)
		{
			record[name[i]-65][record[name[i]-65][0]+1]=temp;
			record[name[i]-65][0]++;
		}
	}
	int flag=0;
	for (int i=0;i<25;i++)
	{
		if (record[i][0]>record[flag][0])
		{
			flag=i;
		}
	}
	cout<<(char)(flag+65)<<endl<<record[flag][0]<<endl;
	for (int i=1;i<=record[flag][0];i++)
	{
		cout<<record[flag][i]<<endl;
	}

	return 0;
}


struct book
{
	char num[4];
	char author[27];
}book[100];
int main()
{
	int n,i,k,sz[26],t,m,e;
	scanf("%d",&n);
	m=0;
	for(i=0;i<26;i++){
		sz[i]=0;
	}
	for(i=0;i<n;i++){
		scanf("%s%s",book[i].num,book[i].author);
		t=strlen(book[i].author);
		for(k=0;k<t;k++){
				sz[book[i].author[k]-'A']++;
		}
	}for(i=0;i<26;i++){
		if(sz[i]>m){
			m=sz[i];
			e=i;
		}
	}printf("%c\n%d\n",e+'A',m);
	for(i=0;i<n;i++){
		t=strlen(book[i].author);
		for(k=0;k<t;k++){
			if(book[i].author[k]==e+'A'){
				printf("%s\n",book[i].num);
			}
		}
	}return 0;
}


main()
{
	int n;
	scanf("%d",&n);
	struct
	{
		int num;
		char a[25];
	}book [999];
	int i,j;
	for(i=0;i<=n-1;i++)
	{
		scanf("%d %s",&book[i].num,book[i].a);
	}
	int s[26]={0};
	for(i=0;i<=n-1;i++)
	{
		int len=strlen(book[i].a);
		for(j=0;j<len;j++)
		{
			s[book[i].a[j]-'A']++;
		}
	}
	int max=0;
	char name;
	for(i=0;i<=25;i++)
	{
		if(s[i]>max)
		{
			max=s[i];
			name='A'+i;
		}
	}
	printf("%c\n",name);
	printf("%d\n",max);
	for(i=0;i<=n-1;i++)
	{
		int len=strlen(book[i].a);
		for(j=0;j<len;j++)
		{
			if(book[i].a[j]==name)
				printf("%d\n",book[i].num);
		}
	}

}


struct book
{
    int num;
	char name[26];
	struct book *next;
};

struct book *creat(int n)
{
	int i;
	struct book *head;
	struct book *p1,*p2;
	p1=p2=(struct book *)malloc(LEN);
	scanf("%d %s",&p1->num,p1->name);
	head=NULL;

	for(i=0;i<n-1;i++)
	{

		if(i==0)head=p1;
		p1=(struct book*)malloc(sizeof(struct book));
		scanf("%d %s",&p1->num,p1->name);
		p2->next=p1;
		p2=p1;
	}
	p2->next=NULL;
	return (head);
}

void main()
{
	int i,n,a[26]={0},max=0,j,k=0;
	char t;
	struct book *p,*p1;
	scanf("%d",&n);
	p=creat(n);
	p1=p;
	for(j=0;j<n;j++)
	{
		for(i=0;*(p->name+i)!='\0';i++)
			a[*(p->name+i)-65]=a[*(p->name+i)-65]+1;
        p=p->next;
	}
	for(i=0;i<26;i++)
	{
		if(a[i]>max){max=a[i];k=i;}
	}
	printf("%c\n%d\n",(k+65),max);
	t=(char)(k+65);

	while(p1!=NULL)
	{
		for(i=0;*(p1->name+i)!='\0';i++)
		{
			if(*(p1->name+i)==t)
			{
				printf("%d\n",p1->num);
				break;
			}
		}
		p1=p1->next;
	}
}


int main()
{
    int m,shu[1000],num[26],length[1000];
    char author[1000][26],maxauthor;
    cin>>m;
    memset(num,0,sizeof(num));
    for(int i=0;i<m;i++)
    {
      cin>>shu[i]>>author[i];
      length[i]=strlen(author[i]);
      for(int j=0;j<length[i];j++)//??????????
      num[author[i][j]-'A']+=1;
    }
    int maxnum=0;
    for(int i=0;i<26;i++)
    {
      if(maxnum<num[i])
      maxnum=num[i];//???????????
    }
    for(int i=0;i<26;i++)
    {
      if(num[i]==maxnum)//???????????
      {
         maxauthor=(char)('A'+i);
         cout<<maxauthor<<endl;
         cout<<maxnum<<endl;
         break;
      }
    }
    for(int i=0;i<m;i++)
    {
      for(int j=0;j<length[i];j++)
      {
         if(author[i][j]==maxauthor)//????????
         cout<<shu[i]<<endl;
      }
    }
    return 0;
}


struct book
{
	int number;
	char name[26];
	int num[26];
};
void mostbook(struct book *p)
{
   int i,j,k;
   k=strlen(p->name);
   for(j=0;j<26;j++)			//???num???
   {
	   p->num[j]=0;
   }
   for(i=0;i<k;i++)
		 (p->num[(p->name[i]-'A')])++;
}

void main()
{
   int i,j,m;
   int max=0;
   int maxi=0;
   int s[26]={0};
   //printf("???????:\n");
   scanf("%d",&m);
   struct book *p;
   p=(struct book *)malloc(m*sizeof(struct book));
      for(i=0;i<m;i++)
   {
	 // printf("????????\n");
      scanf("%d",&(p+i)->number);
	  scanf("%s",&(p+i)->name);
	  mostbook(p+i);
      for(j=0;j<26;j++)
	    s[j]+=((p+i)->num[j]);
	}
   for(i=0;i<26;i++)
   {
	   if(s[i]>=max)
	 {
		 max=s[i];
         maxi=i;
	 }
   }
   //printf("????????\n");
   printf("%c\n",(maxi+'A'));
   //printf("?????\n");
   printf("%d\n",max);
   //printf("?????\n");
   for(i=0;i<m;i++)
   {
	  int k,j;
	  k=strlen((p+i)->name);             //??i?book??
	  for(j=0;j<k;j++)
	  {
		 if((p+i)->name[j]==(maxi+'A'))  //??i?book??
		 {
			 printf("%d\n",(p+i)->number);
			 continue;				//????????????????continue
		 }
	  }
   }

}


struct book{
       int  num;
       char writer[28];
}bo[1000];
int main()
{
    int i,j,k,n,a,b;
    int max=0;
    scanf("%d",&n);
    for(i=0;i<n;i++){
       scanf("%d %s",&bo[i].num,bo[i].writer);
       }
    for(i='Z';i>='A';i--){
        a=0;
        for(k=0;k<n;k++){
            for(j=0;j<27;j++){
                if(bo[k].writer[j]==i){
                   a++;
                  }
               }
           }
        if(a>max){
           max=a;
           b=i;
          }
       }
     printf("%c\n%d\n",b,max);
     for(j=0;j<n;j++){
         for(i=0;i<28;i++){
             if(bo[j].writer[i]==b){
                printf("%d\n",bo[j].num);
               }
            }
        }
     return 0;
}


int cishu[26];

struct shu
{
	int num;
	char name[26];
	struct shu *next;
};

struct shu *app(int n)
{
	int i,len,j;
	struct shu *newnode ,*p, *head;
	for(i=1;i<=n;i++)
	{
		newnode=(struct shu *)malloc(sizeof(struct shu));
		scanf("%d %s", &newnode->num , newnode->name );
		len=strlen(newnode->name );

		for(j=0;j<len;j++)
		{
			cishu[newnode->name[j]-'A']++;
		}

		if(i==1)
		{
			head=newnode;
		}
		else
		{
			p->next =newnode;
		}
		p=newnode;
	}
	p->next =0;
	return head;
}

int max(void)
{
	int m=0, i ,x;
	for(i=0;i<26;i++)
	{
		if(cishu[i]>m)
		{m=cishu[i];
		x=i;}
	}
	return x;
}

int cunzai(char a[],int kk)
{
	int l,i;
	l=strlen(a);
	for(i=0;i<l;i++)
	{
		if(a[i]==kk+'A')
			return 1;
	}
	return 0;
}

int main()
{
	int n,kk;
	struct shu *head, *p;
	scanf("%d",&n);

	head=app(n);
	kk=max();
	printf("%c\n%d\n", 'A'+kk, cishu[kk]);

	for(p=head;p!=0;p=p->next )
	{
		if(cunzai(p->name ,kk))
		{printf("%d\n",p->num );}
	}
	return 0;
}


struct chs{
	char zz[27];
	int num;
}cs[],*p;
int main(){
	int n;
	scanf("%d",&n);
	struct chs *cs=(struct chs *)malloc(sizeof(struct chs)*n);
	for(p=cs;p<cs+n;p++){
		scanf("%d%s",&(p->num),p->zz);
	}
	int l,a,zm[26],*z;
	for(z=zm;z<zm+26;z++){
		*z=0;
	}
	char *q;
	for(p=cs;p<cs+n;p++){
		l=strlen(p->zz);
		for(q=p->zz;*q!='\0';q++){
			a=(int)(*q);
			(*(zm+a-65))++;
		}
	}
	int max=0;
	for(z=zm;z<zm+26;z++){
		if(*z>*(zm+max)){
			max=z-zm;
		}
	}
	printf("%c\n%d\n",(char)(max+65),*(zm+max));
	for(p=cs;p<cs+n;p++){
		l=strlen(p->zz);
		for(q=p->zz;*q!='\0';q++){
			a=(int)(*q);
			if((a-65)==max){
				printf("%d\n",p->num);
			}
		}
	}
	free(cs);
	return 0;
}


int main()
{
	int n;
	cin>>n;
	int book[1000];
	char author[1000][10];
	int i,j;
	for(i=0;i<n;i++){
		cin>>book[i]>>author[i];
	}
	int num[26]={0};
	for(i=0;i<n;i++){
		int length;
		length=strlen(author[i]);
		for(j=0;j<length;j++){
			num[author[i][j]-'A']++;
		}
	}
	int max=0;
	char maxi;
	for(i=0;i<26;i++){
		if(num[i]>max){
			max=num[i];
			maxi='A'+i;
		}
	}
	cout<<maxi<<endl;
	int sum=0;
	for(i=0;i<n;i++){
		int length;
		length=strlen(author[i]);
		for(j=0;j<length;j++){
			if(author[i][j]==maxi){
				sum++;
			}
		}
	}
	cout<<sum<<endl;
	for(i=0;i<n;i++){
		int length;
		length=strlen(author[i]);
		for(j=0;j<length;j++){
			if(author[i][j]==maxi){
				cout<<book[i]<<endl;
			}
		}
	}
	return 0;
}


struct book
{
	int number;
	char writer[26];
	struct book *next;
}

main()
{
	int n,i,j,num[26]={0},nu[26],a,b;
	struct book *head,*p1,*p2;
	scanf("%d",&n);
	p1=p2=(struct book *)malloc(LEN);
	for(i=0;i<n;i++)
	{
		scanf("%d%s",&p1->number,&p1->writer);
		for(j=0;j<strlen(p1->writer);j++)
		{
			++num[p1->writer[j]-65];
		}
		if(i==0)
			head=p1;
		else
			p2->next=p1;
		p2=p1;
		p1=(struct book *)malloc(LEN);
	}
	p2->next=NULL;
	for(i=0;i<26;i++)
	{
		nu[i]=i;
	}
	for(i=0;i<25;i++)
	{
		for(j=0;j<25-i;j++)
		{
			if(num[j]<num[j+1])
			{
				a=nu[j];
				nu[j]=nu[j+1];
				nu[j+1]=a;
				b=num[j];
				num[j]=num[j+1];
				num[j+1]=b;
			}
		}
	}
	printf("%c\n%d\n",nu[0]+65,num[0]);
	for(i=0;i<n;i++)
	{
		for(j=0;j<strlen(head->writer);j++)
		{
			if(head->writer[j]==(char)nu[0]+65)
			{
				printf("%d\n",head->number);
				break;
			}
		}
		head=head->next;
	}
}


struct bo{
	char id[10];
	char au[100];
};

int main(){
	int n,i,j,max;
	char maxa;
	struct bo *book;
	int auth[26];
	memset(auth,0,sizeof(int)*26);
	scanf("%d",&n);
	book=(struct bo *)malloc(sizeof(struct bo)*n);
	for(i=0;i<n;i++){
		scanf("%s%s",book[i].id,book[i].au);
		for(j=0;book[i].au[j];j++){
			auth[book[i].au[j]-'A']++;
		}
	}
	max=0;
	for(i=0;i<26;i++)
	{
		if(max<auth[i]) {
			max=auth[i];
			maxa=i+'A';
		}
	}
	printf("%c\n",maxa);
	printf("%d\n",max);
	for(i=0;i<n;i++){
		if(strchr(book[i].au,maxa))
			printf("%s\n",book[i].id);
	}

	return 0;
}


int main()
{
	struct Book{
		int id;
		char zz[26];
	}book[1000];

	int n,i,j,max=0,index;
	int sum[26]={0};
	char author;
	scanf("%d",&n);
	for (i=0;i<n;i++){
		scanf("%d%s",&book[i].id,&book[i].zz);
	}

	for (i=0;i<n;i++){
		for (j=0;book[i].zz[j]!='\0';j++){
			sum[book[i].zz[j]-'A']++;
		}
	}

	for (i=0;i<26;i++){
		if (sum[i]>max){
			max=sum[i];
			author='A'+i;
		}
	}
	printf("%c\n%d\n",author,max);

	for (i=0;i<n;i++){
		for (j=0;book[i].zz[j]!='\0';j++){
			if (book[i].zz[j]==author){
				printf("%d\n",book[i].id);
				break;
			}
		}
	}
    return 0;
}


int main()
{
    char ma='A';
    int cnt[ASCII]={0};
    int i,j,n;

    struct {
         int id;
         char au[MAX_N+1];
    }bk[MAX_M];

    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];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 book{
	int num;
	char writer[27];
};

void main()
{
	struct book *p,*head;
	int n,i,j,max,maxi;
	int l[26]={0},lnum[999];
	void count(int *l,struct book *p,int lnum);
	int read(struct book *p);

	scanf("%d",&n);
	head=p=(struct book *)calloc(n,sizeof(struct book));
	for(i=0;i<n;i++,p++)
	{
		lnum[i]=read(p);
	}
	p=head;
	for(i=0;i<n;i++)
	{
		count(l,p,lnum[i]);
		p++;
	}
	max=l[0];  maxi=0;
	for(i=1;i<26;i++)
	{
		if(max<l[i])
		{
			max=l[i];
			maxi=i;
		}
	}
	printf("%c\n",65+maxi);
	printf("%d\n",max);
	p=head;
	for(i=0;i<n;i++)
	{
		for(j=0;j<lnum[i];j++)
		{
			if(p->writer[j]==65+maxi)
			{
				printf("%d\n",p->num);
				break;
			}
		}
		p++;
	}
}
int read(struct book *p)
{
	int i=0;
	char d;
	scanf("%d",&p->num);
	d=getchar();
	d=getchar();
	do{
		p->writer[i]=d;
		i++;
	}while((d=getchar())!='\n');
	return(i);
}
void count(int *l,struct book *p,int lnum)
{
	int i;
	for(i=0;i<lnum;i++)
	{
		switch(p->writer[i])
		{
		case'A':l[0]++; break;     case'B':l[1]++; break;
		case'C':l[2]++; break;     case'D':l[3]++; break;
		case'E':l[4]++; break;     case'F':l[5]++; break;
		case'G':l[6]++; break;     case'H':l[7]++; break;
	    case'I':l[8]++; break;     case'J':l[9]++; break;
		case'K':l[10]++; break;     case'L':l[11]++; break;
		case'M':l[12]++; break;     case'N':l[13]++; break;
		case'O':l[14]++; break;     case'P':l[15]++; break;
		case'Q':l[16]++; break;     case'R':l[17]++; break;
		case'S':l[18]++; break;     case'T':l[19]++; break;
		case'U':l[20]++; break;     case'V':l[21]++; break;
		case'W':l[22]++; break;     case'X':l[23]++; break;
		case'Y':l[24]++; break;     case'Z':l[25]++; break;
		}
	}
}


struct author
{
	char name[26];
	int num;
	struct author *next;
};
void main()
{
	int i,n,a[26],j,t;
	struct author *head;
	struct author *p1,*p2;
	p1=p2=(struct author *)malloc(LEN);
	head=NULL;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d %s",&p1->num,p1->name);
		if(i==0) head=p1;
		else p2=p1;
		if(i!=(n-1)) p1=p2->next=(struct author*)malloc(LEN);
		else {p2->next=NULL;}
	}
	for(i=0;i<26;i++)
	{
		a[i]=0;
	}
	p1=head;
	for(p1=head;p1!=NULL;p1=p1->next)
	{
		for(j=0;j<strlen(p1->name);j++)
		{
			a[p1->name[j]-'A']++;
		}
	}
	t=0;
	for(i=0;i<26;i++)
	{
		if(a[i]>a[t]) t=i;
	}
	printf("%c\n%d\n",t+'A',a[t]);
	for(p1=head;p1!=NULL;p1=p1->next)
	{
		for(j=0;j<strlen(p1->name);j++)
		{
			if(p1->name[j]==t+'A') printf("%d\n",p1->num);continue;
		}
	}
}


struct book
{
	int num;
	char zhuzhe[26];
	int let;
};

struct book shu[1000];

int judge(char a,char b)
{
  if(a==b)return(1);
  else return(0);
}

void main()
{
	int n,i,j,y,zhi,num;
	char writer1[26]={0};
char writer2[26]={0};

for(i=0;i<26;i++)
writer2[i]=i+65;

	scanf("%d",&n);
	for(i=0;i<n;i++)
	{scanf("%d",&shu[i].num);
	gets(shu[i].zhuzhe);
	}
for(i=0;i<n;i++)
 for(j=0;shu[i].zhuzhe[j]!='\0';j++)
  for(y=0;y<26;y++)
	  if(writer2[y]==shu[i].zhuzhe[j])writer1[y]=writer1[y]+1;
zhi=0;
num=0;
for(i=0;i<26;i++)
if(writer1[i]>zhi){zhi=writer1[i];num=i;}

for(i=0;i<n;i++)
  for(j=0;shu[i].zhuzhe[j]!='\0';j++)
     if(judge(shu[i].zhuzhe[j],writer2[num])==1)shu[i].let=1;

printf("%c\n",writer2[num]);
printf("%d\n",writer1[num]);
for(i=0;i<n-1;i++)
if(shu[i].let==1)printf("%d\n",shu[i].num);
if(shu[n-1].let==1)printf("%d",shu[n-1].num);
}


int N;
int A[2013],Ans[1222];
char W[2013][28];
double Max(double X,double Y)
{
	return X > Y ? X : Y;
}
int main()
{
	cin >> N;
	for (int I = 1; I <= N; I ++)
		cin >> A[I] >> W[I];
	for (int I = 1; I <= N; I ++)
	{
		int L = strlen(W[I]);
		for (int J = 0; J < L; J ++) Ans[W[I][J]] ++;
	}
	int Max = 0,T;
	for (int I = 65; I <= 'Z'; I ++)
		if (Ans[I] > Max)
		{
			Max = Ans[I];
			T = I;
		}
	printf("%c\n%d\n",T,Max);
	for (int I = 1; I <= N; I ++)
	{
		int L = strlen(W[I]);
		for (int J = 0; J < L; J ++)
			if (W[I][J] == T) cout << A[I] << endl;
	}
}


int main ()
{
	int m, i, j, num[999], store[26][999] = {0} , cal[26] = {0}, max = 0, maxnum;
	char au[999][26];
	cin >> m;
	for(i = 0; i <= m - 1; i++)
	{
		cin >> num[i];
		cin.get();
		cin.getline(au[i], 26);
		for (j = 0; ;j++)
		{
			if(au[i][j] == '\0')
				break;
			else
			{
				store[au[i][j] - 'A'][cal[au[i][j] - 'A']] = num[i];
				cal[au[i][j] - 'A']++;
			}
		}
	}
	for(i = 0; i <= 25; i++)
	{
		if (cal[i] > max)
		{
			max = cal[i];
			maxnum = i;
		}
	}
	char t = 'A' + maxnum;
	cout << t << endl << max << endl;
	for(i = 0; i < max ; i++)
	{
		cout << store[maxnum][i] << endl;
	}
	return 0;
}


struct book{
	int num;
	char author[27];
};
int main()
{
 int n,m,i,j;
 int author_num[26]={0};
 scanf("%d",&n);
 struct book shu[999];
 for(i=0;i<n;i++){
  scanf("%d%s",&shu[i].num,shu[i].author);
 }
 for(i=0;i<n;i++){
	 for(j=0;j<26;j++){
		 m=shu[i].author[j]-'A';
		 author_num[m]++;
	 }
 }
 int max=author_num[0],author='A';
 for(i=1;i<26;i++){
	 if(author_num[i]>max){
		 max=author_num[i];
		 author=i+'A';
	 }
 }
printf("%c\n%d\n",author,max);
for(i=0;i<n;i++){
	 for(j=0;j<26;j++){
		 if(shu[i].author[j]==author){
			 printf("%d\n",shu[i].num);
		 }
	 }
}
return 0;
}


//
//  main.cpp
//  ????
//
//  Created by ???? on 13-12-25.
//  Copyright (c) 2013? ????. All rights reserved.
//

int main()
{

    struct author_book
    {
        int count;
        int book[999];
    } au[26];

    for(int k=0;k<26;k++)
    {
        au[k].count=0;
    }

    int m;
    cin>>m;

    for(int i=1;i<=m;i++)
    {
        int num;
        char a[26];
        cin>>num;
       cin.get();
        cin.getline(a,26);
        for(int k=0;k<strlen(a);k++)
        {
            int author_r=(int)(a[k]-'A');//?????
            au[author_r].book[  au[author_r].count  ]=num;
            au[author_r].count++;
        }
    }

    //find the max
    int max=0;
    int the_one=0;
    for(int i=0;i<26;i++)
    {
        //cout<<au[i].count<<endl;
        if(au[i].count>max)
        {
            max=au[i].count;
            the_one=i;
        }
    }

    //cout author
    char maxau='A'+the_one;
    cout<<maxau<<endl;
    cout<<au[the_one].count<<endl;
    //cout his books
    for(int i=0;i<au[the_one].count;i++)
    {
        cout<<au[the_one].book[i]<<endl;
    }

    return 0;
}


struct inf
{
	int num;
	char name[26];
	struct inf *next;
};

int m;
struct inf *creat(void)
{
	struct inf *head,*p1,*p2;
	int n;
	p1=p2=(struct inf *)malloc(LEN);
	scanf("%d %s",&p1->num,p1->name);
	head=NULL;
	n=0;
	while(1)
	{
		n++;
		if(n==1)
			head=p1;
		else
			p2->next=p1;
		p2=p1;
		if(n==m)
			break;
		else
		{
		p1=(struct inf *)malloc(LEN);
		scanf("%d %s",&p1->num,p1->name);
		}
	}
	p2->next=NULL;
	return(head);
}

void count(struct inf *head,int o)
{
	struct inf *q1;
	int *q2,*q3,*q4;
	char *t1;
	q1=head;
	q2=(int *)malloc(26*LEM);
    for(q3=q2;q3<q2+26;q3++)
        *q3=0;
	while(q1!=NULL)
	{
		for(t1=q1->name;*t1!='\0';t1++)
			*(q2+(*t1-'A'))=*(q2+(*t1-'A'))+1;
		q1=q1->next;
	}
	q4=q2;
    for(q3=q2;q3<q2+26;q3++)
		if(*q4<*q3)
			q4=q3;
	printf("%c\n%d\n",q4-q2+'A',*q4);
	q1=head;
	while(q1!=NULL)
	{
        for(t1=q1->name;*t1!='\0';t1++)
			if(*t1==(q4-q2+'A'))
				printf("%d\n",q1->num);
		q1=q1->next;
	}

}

void main()
{
	struct inf *head,*s;
	scanf("%d",&m);
	head=creat();
	s=head;
	count(head,m);
/*	while(s!=NULL)
	{
		printf("%d %s\n",s->num,s->name);
		s=s->next;
	}*/
}


void main()
{
	int a,m,i,max=0,n,count[26]={0};
	char b;
	struct book
	{
		int id;
		char author[26];
	}book[1024];
		char *p=&book[0].author[0];
		char *q;
   scanf("%d",&m);
   for(i=0;i<m;i++)
   {
	   scanf("%d %s",&book[i].id,book[i].author);
   }
/*
   for(i=0;i<m;i++)
   {
	   printf("%d %s\n",book[i].id,book[i].author);
   }
*/
   for(i=0;i<m;i++)

	for(p=book[i].author;*p!='\0';p++)
	{
		a=*p;
		count[a-65]++;
	}
	for(i=0;i<26;i++)
	{
		if(max<count[i])
		{
			max=count[i];
		    b='A'+i;
		}
	}
	printf("%c\n%d\n",b,max);

	for(i=0;i<m;i++)
	{
		for(q=book[i].author;*q!='\0';q++)
		{
			if(*q==b)	printf("%d\n",book[i].id);
		}
	}
}


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

    return 0;
}


struct book
{
	char writer[26];
	int num;
	struct book *next;
};
struct book *creat()
{
	struct book *head,*p1,*p2;
	int i,m;
	scanf("%d",&m);
	p1=p2=(struct book *)malloc(sizeof(struct book));
	head=NULL;
	for(i=0;i<m;i++)
	{
		if(i==0) head=p1;
		else p2->next=p1;
		p2=p1;
		p1=(struct book *)malloc(sizeof(struct book));
		scanf("%d %s",&p1->num,p1->writer);
		p1->next=NULL;
	}
	p2->next=p1;
	return(head);
}
void main()
{
	int n,a[26][1000]={0},b[26]={0},i,max,k;
	struct book *head,*p;
	char *q;
	head=creat();
	for(p=head->next;p;p=p->next)
	{
		n=strlen(p->writer);
		for(i=0,q=p->writer;i<n;i++,q++)
		{
			a[*q-65][b[*q-65]]=p->num;
			b[*q-65]++;
		}
	}
	max=b[0];
	k=0;
	for(i=0;i<26;i++)
	{
		if(b[i]>max)
		{
			max=b[i];
			k=i;
		}
	}
	printf("%c\n%d\n",k+65,max);
	for(i=0;i<max;i++)
		printf("%d\n",a[k][i]);
}


int main()
{
	int m,i,j,k,max=-1;
	int c[26];
	char prname;
	struct list
	{
		int num;
		char writer[27];
		int len;
	}book[999];
	scanf("%d",&m);
	for(i=0;i<m;i++)
	{
		scanf("%d",&book[i].num);
		gets(book[i].writer);
		book[i].len=strlen(book[i].writer);
	}
	for(i=0;i<26;i++)
		c[i]=0;
	for(i=0;i<m;i++)
	{
		for(j=0;j<book[i].len;j++)
		{
			switch(book[i].writer[j])
			{
			case 'A':c[0]++;break;
			case 'B':c[1]++;break;
			case 'C':c[2]++;break;
			case 'D':c[3]++;break;
			case 'E':c[4]++;break;
			case 'F':c[5]++;break;
			case 'G':c[6]++;break;
			case 'H':c[7]++;break;
			case 'I':c[8]++;break;
			case 'J':c[9]++;break;
			case 'K':c[10]++;break;
			case 'L':c[11]++;break;
			case 'M':c[12]++;break;
			case 'N':c[13]++;break;
			case 'O':c[14]++;break;
			case 'P':c[15]++;break;
			case 'Q':c[16]++;break;
			case 'R':c[17]++;break;
			case 'S':c[18]++;break;
			case 'T':c[19]++;break;
			case 'U':c[20]++;break;
			case 'V':c[21]++;break;
			case 'W':c[22]++;break;
			case 'X':c[23]++;break;
			case 'Y':c[24]++;break;
			case 'Z':c[25]++;break;
			}
		}
	}
	for(i=0;i<26;i++)
	{
		if(c[i]>max)
			max=c[i];
		else
			continue;
	}
	for(i=0;i<26;i++)
	{
		if(c[i]!=max)
			continue;
		else
		{
			prname=i+65;
			printf("%c\n",prname);
			printf("%d\n",max);
			for(j=0;j<m;j++)
			{
				for(k=0;k<book[j].len;k++)
				{
					if(book[j].writer[k]!=prname)
						continue;
					else
					{
						printf("%d\n",book[j].num);
						break;
					}
				}
			}
			break;
		}
	}
	return 0;
}


int main()
{
    int n,i,j;
    cin >> n;
    char number[1000][5]={' '};
    char authors[1000][30]={' '};
    int author[30]={0};
    for (i=0;i<=n-1;i++)
    {
        cin >> number[i] >> authors[i];
        int len1=strlen(authors[i]);

        for (j=0;j<=len1-1;j++)
        {
            author[authors[i][j]-'A']++;
        }
    }
    int k,kmax=0;
    int max=author[0];
    for (k=1;k<=25;k++)
    {
        if (author[k]>max)
        {
            max=author[k];
            kmax=k;
        }
    }
    char writer=kmax+'A';
    cout << writer << endl;
    cout << max << endl;
    for (i=0;i<=n-1;i++)
    {
        for (j=0;j<=25;j++)
        {
            if (authors[i][j]-'A'==kmax)
            {
                cout << number[i] << endl;
                break;
            }
        }
    }

    return 0;
}


struct stu
{
	int n;
	char name[27];
	struct stu *next;
};
void main()
{
	int m;
	scanf("%d",&m);
	struct stu *head,*p1,*p2,*p3;
	head=p1=(struct stu*)malloc(LEN);
	scanf("%d %s",&p1->n,p1->name);
	int i=0;
	for(;i<m-1;i++)
	{
		p2=(struct stu*)malloc(LEN);
		scanf("%d %s",&p2->n,p2->name);
		p1->next=p2;
		p1=p2;
	}
	p2->next=NULL;
	int sum[26];
	for(i=0;i<26;i++) sum[i]=0;
	for(p1=head;p1!=NULL;p1=p1->next)
	{
		char *p=p1->name;
		while(*p!='\0')
		{
			int a=*p;
			sum[a-65]=sum[a-65]+1;
			p=p+1;
		}
	}
	int max=sum[0];
	char j='A';
	for(i=0;i<26;i++)
	{
		if(sum[i]>max)
		{
			max=sum[i];
			j=i+65;
		}
	}
	printf("%c\n%d\n",j,max);
	for(p1=head;p1!=NULL;p1=p1->next)
	{
		char *p=p1->name;
		for(;*p!='\0';p++)
		if(*p==j)
		{printf("%d\n",p1->n);break;}
	}
}


int main(int argc, char* argv[])
{
    char m = 0;
    int cnt[255], i, j, n;
    struct {
        int id;
        char au[32];
    } bk[1000];

    memset(cnt, 0, sizeof(cnt));
    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]; j++)
            if (++cnt[bk[i].au[j]] > cnt[m])
                m = bk[i].au[j];
    }

    printf("%c\n%d\n", m, cnt[m]);
    for (i = 0; i < n; i++)
        if (strchr(bk[i].au, m))
            printf("%d\n", bk[i].id);

    return 0;
}


struct node  //??????
{
	int num;
	char name[26];
	struct node *next;
};
int n=1,m;
struct zuozhe
{
	char name;
	int books[300];
	int num;
}zuozhe[26];

struct node  *getlinked()
{
	struct node *head,*newnode,*thisnode;
//	printf("Please input the number and data (-1 -1 to end):\n");
	do
	{
		newnode=(struct node *)malloc(sizeof(struct node)); //??????????
		if(newnode==NULL) //malloc???
		{
			printf("malloc failed");
			exit(-1);
		}
		scanf("%d%s",&newnode->num,&newnode->name);
		newnode->next=NULL;
		if(n==1)  //???????????thisnode?head????newnode
		{
			thisnode=newnode;
			head=newnode;
		}
		else //?????????????
		{
			thisnode->next=newnode;
		}
		if(n<=m)
		{
			thisnode=newnode; //????
			n++; //????
		}
	}while(n<=m);
	return head;
}
void tongji(struct node *p,int n)
{
	int i,j;
	for(i=1;i<=n;i++)
	{
		for(j=0;j<strlen(p->name);j++)
		{
			zuozhe[(p->name)[j]-'A'].books[zuozhe[(p->name)[j]-'A'].num]=p->num;
			zuozhe[(p->name)[j]-'A'].num++;
		}
		p=p->next;
	}
}

void bubble(struct zuozhe array[],int n)
{
	int i=0,pass;
	struct zuozhe temp;

	for(pass=1;pass<=n;pass++)
	{
		for(i=0;i<n-pass;i++)
		{
			if(array[i].num<array[i+1].num)
			{
				temp=array[i];
				array[i]=array[i+1];
				array[i+1]=temp;
			}
		}
	}
	return;
}

void main()
{
	struct node *p;
	int i;
	scanf("%d",&m);
	p=getlinked();
	for(i=0;i<26;i++)
	{
		zuozhe[i].name='A'+i;
		zuozhe[i].num=0;
	}
	tongji(p,m);
	bubble(zuozhe,26);
	printf("%c\n%d\n",zuozhe[0].name,zuozhe[0].num);
	for(i=0;i<zuozhe[0].num;i++)
	{
		printf("%d\n",zuozhe[0].books[i]);
	}
}


struct a
{
	int number;
	char authors[26];
	struct a*next;
};
int n,max=0;
int main()
{
	struct a*create(void);
	char sum(struct a*);
	void pr(char x,struct a*head);
	struct a*head;
	char x;
	scanf("%d",&n);
	head=create();
	x=sum(head);
	pr(x,head);
}
struct a*create(void)
{
	struct a*head,*p1,*p2;
	int i;
	p1=len;head=p1;p2=p1;
	for(i=0;i<n;i++)
	{
		scanf("%d %s",&p1->number,p1->authors);
		if(i!=n-1)
		{p1=len;p2->next=p1;p2=p2->next;}
		else p1->next=null;
	}
	return head;
}
char sum(struct a*head)
{
	struct a*p;
	p=head;
	int a[26]={0},i,j;
	char zd;
	for(i=0;i<n;i++)
	{
		for(j=0;*(p->authors+j)!='\0';j++)
			a[*(p->authors+j)-65]++;
		p=p->next;
	}
	for(i=0;i<26;i++)
		if(a[i]>max){max=a[i];zd=i;}
	printf("%c\n%d",zd+65,a[zd]);
	return(zd+65);
}
void pr(char x,struct a*head)
{
	int i,j,num;
	struct a*p;
	p=head;
	for(i=0;i<n;i++)
	{
		num=0;
		for(j=0;*(p->authors+j)!='\0';j++)
			if(*(p->authors+j)==x)num=1;
		if(num)printf("\n%d",p->number);
		p=p->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 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 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
{
	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++;}
}


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;
}


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;
}


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;
}


struct inf
{
	int sum;
	char write[1000][4];
};
int main()
{
	int m;
	int i,j;
	char name[5];
	char author[27];
	struct inf book[26];
	for(i=0;i<26;i++)
		book[i].sum=0;

	cin >> m ;
	cin.get();

	while( m -->0 )
	{
		cin.get( name,5);
		cin.getline( author,27);
		for(i=0;i <strlen(author);i++)
		{
			book[author[i]-'A'].sum++;
			for( j=0;j<=3;j++)
			{
				if(j<3)
				book[author[i]-'A'].write[book[author[i]-'A'].sum][j] = name[j];
				else
					book[author[i]-'A'].write[book[author[i]-'A'].sum][j]='\0';
			}
		}
	}

	int max=0,t;
	for(i=0;i<26;i++)
	{
		if(book[i].sum>max)
		{
			t=i;
			max = book[i].sum;
		}

	}

	cout << (char)(t+'A')  << endl << book[t].sum << endl;
	for( i=1;i<=book[t].sum;i++)
		cout << book[t].write[i] << endl;
	return 0;
}