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

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


a.sort(reverse=True)
b.sort(reverse=True)


if sum(a) > sum(b):
    print("Algosia")
elif sum(a) < sum(b):
    print("Bajtek")
else:
    for i in range(18):
        if (a[i] > b[i]):
            print("Algosia")
            f = 1
            break
        if a[i] < b[i]:
            print("Bajtek")
            f = 1
            break
        else:
            continue
    if not f:
        print("remis")