1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]

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

if sum(a) > sum(b):
    print("Algosia")
elif sum(a) < sum(b):
    print("Bajtek")
else:
    if a > b:
        print("Algosia")
    elif a < b:
        print("Bajtek")
    else:
        print("remis")