#include <iostream>
#include <cstring>
using namespace std;
int main()
{
string str;
int arr[2] = { 0 };
int max = 0;
cin >> str;
const char* p = str.c_str();
while (*p != '0')
{
switch (*p)
{
case 'A':
arr[0]++;
break;
case 'B':
arr[1]++;
break;
}
p++;
}
if (arr[0] >arr[1])
{
cout << 'A' << endl;
}
else if (arr[1] > arr[0])
{
cout << 'B' << endl;
}
else if (arr[1] == arr[0])
{
cout << 'E' << endl;
}
return 0;
}
#include <cstring>
using namespace std;
int main()
{
string str;
int arr[2] = { 0 };
int max = 0;
cin >> str;
const char* p = str.c_str();
while (*p != '0')
{
switch (*p)
{
case 'A':
arr[0]++;
break;
case 'B':
arr[1]++;
break;
}
p++;
}
if (arr[0] >arr[1])
{
cout << 'A' << endl;
}
else if (arr[1] > arr[0])
{
cout << 'B' << endl;
}
else if (arr[1] == arr[0])
{
cout << 'E' << endl;
}
return 0;
}