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

a = [int(i) for i in a]
b = [int(i) for i in b]

a_sum = sum(a)
b_sum = sum(b)

if (a_sum > b_sum):
    print("Algosia")
elif (b_sum > a_sum):
    print("Bajtek")
else:
    winner = False
    for i in range(10, -1, -1):
        if (a.count(i) > b.count(i)):
            print("Algosia")
            winner = True
            break
        elif (b.count(i) > a.count(i)):
            print("Bajtek")
            winner = True
            break
    if (not winner):
        print("remis")