#include<stdio.h>
int main()
{
int ch=0;
int a = 0;
int b = 0;
while (((ch=getchar())!='0')&&ch!=EOF)
{
if (ch == 'A')
{
a++;
}
else if (ch== 'B')
{
b++;
}
}
if (a > b)
{
printf("A\n");
}
if (a < b)
{
printf("B\n");
}
if (a == b)
{
printf("E");
}
return 0;
}