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

algosia = read()
bajtek = read()

if algosia > bajtek:
    print("Algosia")
elif algosia < bajtek:
    print("Bajtek")
else:
    print("remis")