1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
algosia = input()
bajtek = input()

def kto(algosia, bajtek):
    algosia = [int(x) for x in algosia.split(' ')]
    bajtek = [int(x) for x in bajtek.split(' ')]

    def who(algosia, bajtek):
        for i in range(10,0,-1):
            if algosia.count(i) > bajtek.count(i):
                return 'Algosia'
            elif algosia.count(i) < bajtek.count(i):
                return 'Bajtek'
        return 'remis'

    if sum(algosia) > sum(bajtek):
        return 'Algosia'
    elif sum(algosia) < sum(bajtek):
        return 'Bajtek'
    else:
        return who(algosia, bajtek)

print(kto(algosia, bajtek))