1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Algosia = input().split()
Bajtek = input().split()


isNotResult = True
sumaAlgosi = 0
sumaBajtka = 0
for i in range(18):
    sumaAlgosi += int(Algosia[i])
    sumaBajtka += int(Bajtek[i])
if sumaAlgosi > sumaBajtka:
    print("Algosia")
elif sumaAlgosi < sumaBajtka:
    print("Bajtek")
else:
    for i in range(11):
        if (Algosia.count(str(10-i)) > Bajtek.count(str(10-i))):
            print("Algosia")
            isNotResult = False
            break
        elif (Algosia.count(str(10-i)) < Bajtek.count(str(10-i))):
            print("Bajtek")
            isNotResult = False
            break
    if isNotResult:
        print("remis")