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
27
28
29
30
31
32
33
34
35
import sys




algosia=[]
bajtek=[]
a_count=0
b_count=0
for i in input().split():
    algosia.append(int(i))
    a_count = a_count+int(i)

for i in input().split():
    bajtek.append(int(i))
    b_count = b_count+int(i)
    
if (a_count > b_count):
    print("Algosia")
    quit()
if (b_count > a_count):
    print("Bajtek")
    quit()


algosia.sort(reverse=True)
bajtek.sort(reverse=True)
for i in range(18):
    if (algosia[i] > bajtek[i]):
        print("Algosia")
        quit()
    if (bajtek[i] > algosia[i]):
        print("Bajtek")
        quit()
print("remis")