1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <bits/stdc++.h>
using namespace std;

int a, tab[3][12];

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	for (int i = 1; i <= 2; ++i){
		for (int j = 1; j <= 18; ++j){
			cin >> a;
			++tab[i][a];
			tab[i][11] += a;
		}
	}
	for (int i = 11; i > 0; --i){
		if (tab[1][i] > tab[2][i])
			cout << "Algosia", exit(0);
		if (tab[1][i] < tab[2][i])
			cout << "Bajtek", exit(0);
	}
	cout << "remis";
}