1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# total arguments

listAlg = list(map(int, input().split()))
listBai = list(map(int, input().split()))

countAlg = sum(listAlg)
countBaj = sum(listBai)

i = 10
while(countAlg == countBaj and i > 0):
    countAlg = listAlg.count(i)
    countBaj = listBai.count(i)
    i-=1

if(countAlg > countBaj):
    print("Algosia")
elif(countAlg < countBaj):
    print("Bajtek")
else:
    print("remis")