#include <iostream>
using namespace std;

int main() {
    string a;
    int countA = 0, countB = 0;
    cin >> a;
    for(char c :a){
        if(c == 'A') countA++;
        if(c == 'B') countB++;
    }
    char out = countA > countB ? 'A': 'B';
    if(countA == countB) cout << 'E' << endl;
    else cout << out << endl;
}
// 64 位输出请用 printf("%lld")