1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
a=[int(i) for i in input().split(' ')]
b=[int(i) for i in input().split(' ')]
if sum(a) == sum(b):
    for i in range(10, 0, -1):
        c=a.count(i);d=b.count(i)
        if c==d:continue
        if c>d:print("Algosia");exit()
        print("Bajtek");exit()
    print("remis")
elif sum(a) > sum(b):print("Algosia")
else:print("Bajtek")