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
A = input().split()
B = input().split()
Algosia = 0
Bajtek  = 0
A_list = [0,0,0,0,0,0,0,0,0,0,0]
B_list = [0,0,0,0,0,0,0,0,0,0,0]
for i in A:
    i = int(i)
    Algosia += i
    A_list[i] += 1
for i in B:
    i = int(i)
    Bajtek += i
    B_list[i] += 1

if Algosia > Bajtek:
    print("Algosia")
elif Algosia < Bajtek:
    print("Bajtek")
else:
    i = 10
    while i != 0:

        if A_list[i] > B_list[i]:
            print("Algosia")
            break
        elif A_list[i] < B_list[i]:
            print("Bajtek")
            break
        else:
            i -= 1
    if i == 0:
        print("remis")