1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
#include <bits/stdc++.h>
using namespace std;
int as, bs;
array<int, 11> a, b;
int main(){
ios::sync_with_stdio(0);
for(int j=0, x; j<18;++j){cin >> x; as += x; a[10-x]++;}
for(int j=0, x; j<18;++j){cin >> x; bs += x; b[10-x]++;}
auto p = make_pair(as, a) <=> make_pair(bs, b);
cout << (p > 0 ? "Algosia" : p < 0 ? "Bajtek" : "remis");
}