1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
A = sorted(map(int, input("").split()), reverse=True)
B = sorted(map(int, input("").split()), reverse=True)
if sum(A) - sum(B) > 0:
    print("Algosia")
elif sum(B) - sum(A) > 0:
    print("Bajtek")
else:
    for i in range(18):
        if A == B:
            print("remis")
            break
        elif A[i] > B[i]:
            print("Algosia")
            break
        elif A[i] < B[i]:
            print("Bajtek")
            break