#include<stdio.h>
int main(void)
{
char s;
int coutA=0,coutB=0;
while((s=getchar())!='0')//关键是要看输入符号结束的设定
{
if(s=='A')
coutA++;
else
coutB++;
}
if(coutA>coutB)
printf("A");
else if(coutA<coutB)
printf("B");
else
printf("E");
return 0;
}