import java.util.Scanner;
public class Main{
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        while(scan.hasNextLine()) {
            String str = scan.nextLine();
            int aNum = str.replace("B", "").length() - 1;//将B去掉,再把结尾“0”去掉,可得到A的数
            int bNum = str.replace("A", "").length() - 1;//
            if(aNum > bNum) {
                System.out.println('A');
            } else if(aNum < bNum) {
                System.out.println('B');
            } else {
                System.out.println('E');
            }
            
        }
    }
}