import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String str = sc.next();
int counta = 0;
int countb = 0;
for(int i = 0 ; i < str.length() ; i++) {
if(str.charAt(i) == 'A') {
counta++;
} else if(str.charAt(i) == 'B') {
countb++;
}
}
if(counta > countb) {
System.out.println("A");
} else if(counta == countb) {
System.out.println("E");
} else {
System.out.println("B");
}
}
}