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

int a[20];
int b[20];
int ilea[20];
int ileb[20];
int main(){
    int p;
    for (int i = 0; i<18; i++){
        cin>>a[i];
        ilea[11] += a[i];
        ilea[a[i]]++;
    }
    for (int i = 0; i<18; i++){
        cin>>b[i];
        ileb[11] += b[i];
        ileb[b[i]]++;
    }
    bool b = true;
    for (int i = 11; i>=0; i--){
        if(ilea[i]>ileb[i]){
            b = false;
            cout<<"Algosia\n";
            break;
        }
        if(ileb[i]>ilea[i]){
            b = false;
            cout<<"Bajtek\n";
            break;
        }
    }
    if(b){
        cout<<"remis\n";
    }
}