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
#include <bits/stdc++.h>
using namespace std;
#define all(x) x.begin(), x.end()
int n=18;

int INT() {
	int in; scanf("%d", &in);
	return in;
}

int main() {
	vector <int> a(n), b(n);
	int s=0;
	for(int &x : a) x=INT(), s+=x;
	for(int &x : b) x=INT(), s-=x;
	if(s>0) printf("Algosia\n"), exit(0);
	else if(s<0) printf("Bajtek\n"), exit(0);
	sort(all(a)), sort(all(b));
	for(int i=n-1; i>=0; --i) {
		if(a[i]>b[i]) printf("Algosia\n"), exit(0);
		else if(a[i]<b[i]) printf("Bajtek\n"), exit(0);
	}
	printf("remis\n");
	exit(0);
}