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
#include <bits/stdc++.h>
using namespace std;
const int MX = 10;
int cnt[2][MX+1];
int main(){
	ios_base::sync_with_stdio(0); cin.tie(0);
	int n = 18;
	for(int c = 0;c<2;c+=1){
		for(int i = 0;i<n;i+=1){
			int val;
			cin>>val;
			cnt[c][val] += 1;
		}
	}
	for(int i = MX+1;i>=0;i-=1){
		if (cnt[0][i]>cnt[1][i]){
			cout<<"Algosia\n";
			return 0;
		}
		if (cnt[0][i]<cnt[1][i]){
			cout<<"Bajtek\n";
			return 0;
		}
	}
	cout<<"remis\n";
	return 0;
}