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
def main(algosia, bajtek):
    count1 = [0 for _ in range(11)]
    count2 = [0 for _ in range(11)]
    for a, b in zip(algosia, bajtek):
        count1[a] += 1
        count2[b] += 1

    diff = sum(count1) - sum(count2)
    if diff > 0:
        print('Algosia')
    elif diff < 0:
        print('Bajtek')
    else:
        for i in range(10, -1, -1):
            if count1[i] != count2[i]:
                if count1[i] > count2[i]:
                    print('Algosia')
                else:
                    print('Bajtek')
                return
        print('remis')


rl = lambda: list(map(int, input().split()))
main(rl(), rl())