1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
_t = 1
# _t = int(input())

for _ in range(_t):
    a, b = map(lambda _: sorted(map(int, input().split()), reverse=True), range(2))

    sa, sb = map(sum, (a, b))

    cmp = lambda x, y: 1 if x > y else (0 if x == y else -1)

    res = cmp(sa, sb)

    if not res:
        res = cmp(a, b)

    print(['remis', 'Algosia', 'Bajtek'][res])