1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
suma1 = sum(a)
suma2 = sum(b)
if suma1 > suma2:
    print("Algosia")
elif suma1 < suma2:
    print("Bajtek")
else:
    a.sort(reverse=True)
    b.sort(reverse=True)
    if a > b:
        print("Algosia")
    elif a < b:
        print("Bajtek")
    else:
        print("remis")