#include <stdio.h>
#include <string.h>
int main() {
   char arr[1000];
    while (scanf("%s", arr) != EOF) { // 注意 while 处理多个 case
        // 64 位输出请用 printf("%lld") to 
        int countA = 0;
        int countB = 0;
        int sz = strlen(arr);
        int i;
        //找出A,B并计数
        for(i = 0; i< sz; i++)
        {
          if(arr[i] == 'A')
          {
            countA++;
          }
          else if(arr[i] == 'B')
          {
            countB++;
          }
        }
        //打印
        if (countA > countB)
        {
            printf("A\n");
        }
        else if(countA == countB)
        {
            printf("E\n");
        }
        else 
        {
            printf("B\n");
        }
    }
    return 0;
}

笨小猴写完之后这个显得得心应手