#include <stdio.h>

int main() {
	int A = 0;
	char vote = ' ';
	for (int i = 0; scanf("%c", &vote) != -1; i++) {
		if ('A' == vote) {
			A++;
		}
		else if('B' == vote) {
			A--;
		}
	}
	if (A > 0) {
		printf("A");
	}
	else if(A < 0){
		printf("B");
	}
	else {
		printf("E");
	}
	return 0;
}