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

unordered_map<int,int> Amap,Bmap;

string solve(int A,int B)
{
    if(A!=B){
        return (A>B ? "Algosia" : "Bajtek");
    }
    for(int i=10;i>0;i--)
    {
        if(Amap[i]!=Bmap[i])
        return (Amap[i]>Bmap[i] ? "Algosia" : "Bajtek");
    }
    return "remis";
}

int main()
{
    int A=0;
    int B=0;
    int N=18;
    for (int i=0;i<N;i++)
    {
        int x;cin>>x;
        Amap[x]++;
        A+=x;
    }
    for (int i=0;i<N;i++)
    {
        int x;cin>>x;
        Bmap[x]++;
        B+=x;
    }
    cout<<solve(A,B);
}