ll=list(input())
countA = ll.count('A')
countB = ll.count('B')
if countA == countB:
    print('E')
elif countA > countB:
    print('A')
else:
    print('B')