1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include<bits/stdc++.h>
using namespace std;
int t1[12],t2[12];
int main(){
    for(int i = 1;i <= 18;i++){
        int a;
        cin >> a;
        t1[11]+=a;
        t1[a]++;
    }
    for(int i = 1;i <= 18;i++){
        int a;
        cin >> a;
        t2[11]+=a;
        t2[a]++;
    }
    for(int i = 11;i >= 1;i--){
        if(t1[i] > t2[i]){
            cout << "Algosia\n";
            return 0;
        }
        if(t2[i] > t1[i]){
            cout << "Bajtek\n";
            return 0;
        }
    }
    cout << "remis\n";
}