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

int main(){
	ios_base::sync_with_stdio(false), cin.tie(nullptr);
	vector<vector<int> > vals(2);
	for(int it = 0; it < (int)vals.size(); it++){
		vector<int> scores(18);
		for(int& x : scores) cin >> x;
		vector<int> freq(11, 0);
		int tot = 0;
		for(int x : scores){
			tot += x;
			freq[x]++;
		}
		vector<int> val;
		val.push_back(tot);
		for(int i = 10; i >= 0; i--) val.push_back(freq[i]);
		vals[it] = val;
	}
	if(vals[0] > vals[1]){
		cout << "Algosia" << '\n';
	} else if(vals[0] < vals[1]){
		cout << "Bajtek" << '\n';
	} else {
		cout << "remis" << '\n';
	}
}