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
#!/usr/bin/env python3
a = list(reversed(sorted(map(int, input().split(" ")))))
b = list(reversed(sorted(map(int, input().split(" ")))))

A_WINS = "Algosia"
B_WINS = "Bajtek"
DRAW = "remis"

def f(x, y):
    if x > y: return 1
    elif x < y: return -1
    else: return 0
    
sa = sum(a)
sb = sum(b)
if sa > sb:
    print(A_WINS)
elif sb > sa:
    print(B_WINS)

else:
    for val in [f(x,y) for (x,y) in zip(a,b)]:
        if val == 1:
            print(A_WINS)
            exit(0)
        elif val == -1:
            print(B_WINS)
            exit(0)
    print(DRAW)
    exit(0)