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
#include<bits/stdc++.h>
using namespace std;
int a;
int cnt1[12], cnt2[12];
int ans;
int main () {
    for (int i = 0; i < 18; i++) {
        cin >> a;
        cnt1[a]++;
        cnt1[11] += a;
    }
    for (int i = 0; i < 18; i++) {
        cin >> a;
        cnt2[a]++;
        cnt2[11] += a;
    }
    for (int i = 11; i >= 0; i--) {
        if (cnt1[i] > cnt2[i]) {
            ans = 1;
            break;
        } else if (cnt1[i] < cnt2[i]) {
            ans = 2;
            break;
        }
    }
    if (ans == 0) {
        cout << "remis" << "\n";
    } else if (ans == 1) {
        cout << "Algosia" << "\n";
    } else {
        cout << "Bajtek" << "\n";
    }
    return 0;
}