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
import numpy as np
from collections import Counter

algosia_results = np.array([int(x) for x in input().split()])
bajtek_results = np.array([int(x) for x in input().split()])

algosia_sum = algosia_results.sum()
bajtek_sum = bajtek_results.sum()

if algosia_sum > bajtek_sum:
    print('Algosia')
elif algosia_sum < bajtek_sum:
    print('Bajtek')
else:
    algosia_counter = Counter(algosia_results)
    bajtek_counter = Counter(bajtek_results)
    winner = 0

    for i in range(10, 0, -1):
        if algosia_counter[i] > bajtek_counter[i]:
            winner = 1
            break
        elif algosia_counter[i] < bajtek_counter[i]:
            winner = -1
            break

    if winner == 1:
        print('Algosia')
    elif winner == -1:
        print('Bajtek')
    else:
        print('remis')