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
#include <bits/stdc++.h>
using namespace std;
int main(){
    int a;
    vector<int> v1(11,0),v2(11,0);
    int sum1=0,sum2=0;
    for(int i=0;i<18;i++){
        cin>>a;
        v1[a]++;
        sum1+=a;
    }
    for(int i=0;i<18;i++){
        cin>>a;
        v2[a]++;
        sum2+=a;
    }
    if(sum1!=sum2){
        if(sum1>sum2){ cout<<"Algosia";return 0;}
        else{ cout<<"Bajtek";return 0;}
    }
    for(int i=10;i>=0;i--){
        if(v1[i]!=v2[i]){
            if(v1[i]>v2[i]){cout<<"Algosia";return 0;}
            else{cout<<"Bajtek";return 0;}
            
        }
    }
    cout<<"remis";

}