1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
a = list(map(int,input().split()))
b = list(map(int,input().split()))
a1 = sum(a)
b1 = sum(b)
n = 10
while n > 0 and a1 == b1:
    a1 = a.count(n)
    b1 = b.count(n)
    n -= 1
if a1 > b1:
    print("Algosia")
elif b1 > a1:
    print("Bajtek")
else:
    print("remis")