#include<stdio.h>
#include<string.h>
int main() {
char ch[100] = {0};
int i = 0, sum1 = 0, sum2 = 0;
scanf("%s", ch);
int sz = strlen(ch);
for (i = 0; i <sz; i++) {
if (ch[i] == 'A')
sum1++;
if (ch[i] == 'B')
sum2++;
}
if (sum1 > sum2)
printf("A\n");
else if(sum1 < sum2)
printf("B\n");
else if(sum1==sum2)
printf("E\n");
}