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
29
30
31
#include <bits/stdc++.h>
using namespace std;

int main(){
    int a, b;
    vector <int> A(11), B(11);

    for(int i = 1; i<=18; ++i){
        int x; cin >> x;

        a += x;
        A[10-x]++;
    }

    for(int i = 1; i<=18; ++i){
        int x; cin >> x;

        b += x;
        B[10-x]++;
    }

    if(a < b){
        cout << "Bajtek\n";
    }else if(a > b){
        cout << "Algosia\n";
    }else{
        if(A < B) cout << "Bajtek\n";
        else if(A > B) cout << "Algosia\n";
        else cout << "remis\n";
    }
}