1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
def get_score():
    scores = [int(x) for x in input().split()]
    return sum(scores), sorted(scores, reverse=True)

a_scores = get_score()
b_scores = get_score()
if a_scores > b_scores:
    print("Algosia")
elif b_scores > a_scores:
    print("Bajtek")
else:
    print("remis")