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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include <iostream>
#include <vector>
using namespace std;

string compareResults(const vector<int>& algosia, const vector<int>& bajtek) {
    int totalAlgosia = 0, totalBajtek = 0;


    for (int i = 0; i < 18; ++i) {
        totalAlgosia += algosia[i];
        totalBajtek += bajtek[i];
    }

    if (totalAlgosia > totalBajtek) return "Algosia";
    if (totalBajtek > totalAlgosia) return "Bajtek";


    for (int i = 10; i > 0; --i) {
        int countAlgosia = 0, countBajtek = 0;

        for (int j = 0; j < 18; ++j) {
            if (algosia[j] == i) countAlgosia++;
            if (bajtek[j] == i) countBajtek++;
        }

        if (countAlgosia > countBajtek) return "Algosia";
        if (countBajtek > countAlgosia) return "Bajtek";
    }

    return "remis";
}

int main() {
    vector<int> algosia(18), bajtek(18);

    for (int i = 0; i < 18; ++i) {
        cin >> algosia[i];
    }


    for (int i = 0; i < 18; ++i) {
        cin >> bajtek[i];
    }


    cout << compareResults(algosia, bajtek) << endl;

    return 0;
}