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
a = list(map(int, input().split()))
b = list(map(int, input().split()))


a_results = [0] * 11
b_results = [0] * 11

for i in range(18):
    a_results[a[i]] += 1
    b_results[b[i]] += 1

output = "remis"

if sum(a) > sum(b):
    output = "Algosia"
elif sum(a) < sum(b):
    output = "Bajtek"
else:
    for i in range(10, -1, -1):
        if a_results[i] > b_results[i]:
            output = "Algosia"
            break
        if a_results[i] < b_results[i]:
            output = "Bajtek"
            break

print(output)