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
#include<bits/stdc++.h>

using namespace std;

int main() {
    vector<vector<int>> gracze = {vector<int>(12, 0), vector<int>(12, 0)};
    for (auto& gracz : gracze) {
        for (int i = 0; i < 18; ++i) {
            int x;
            cin >> x;
            ++gracz[x];
            gracz[11] += x;
        }
    }
    for (int i = 11; i >= 0; --i) {
        if (gracze[0][i] > gracze[1][i]) {
            cout << "Algosia\n";
            return 0;
        } else if (gracze[0][i] < gracze[1][i]) {
            cout << "Bajtek\n";
            return 0;
        }
    }
    cout << "remis\n";
    return 0;
}