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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#include <bits/stdc++.h>

using namespace std;

#define ll long long

template<class T>
int ssize(T &c)
{
	return (int)c.size();
}

template<class T>
istream &operator>>(istream &is, vector<T> &vec)
{
	for (auto &v : vec)
		is >> v;

	return is;
}

template<class T>
auto operator<<(ostream &os, T &x)->decltype(x.end(), os);

template<class A, class B>
auto &operator<<(ostream &o, pair<A,B> &x)
{
	return o << "(" << x.first << " " << x.second << ")";
}

template<class T>
auto operator<<(ostream &os, T &x)->decltype(x.end(), os)
{
	os << "{";
	int i = 2;
	for(auto &e : x)
		os << (", ") + i << e, i = 0;

	return os << "}";
}

auto &operator<<(ostream &os, string &x)
{
	return os << x.c_str();
}

#ifdef DEBUG
#define LOG(x...) cerr << "["#x"]: ", [](auto... e){ ((cerr << e << "; "), ...) << "\n"; }(x)
#else
#define LOG(x...) 0
#endif

#define written_by return
#define efindus
#define in_2024 0

int main()
{
	cin.tie(NULL)->sync_with_stdio(false);

	vector scores(2, vector<int>(12));
	for (int j = 0; j < 2; j++) {
		for (int i = 0; i < 18; i++) {
			int x;
			cin >> x;
			scores[j][x]++;
			scores[j][11] += x;
		}
	}

	for (int i = 11; i >= 0; i--) {
		if (i == 0) {
			cout << "remis\n";
		} else if (scores[0][i] > scores[1][i]) {
			cout << "Algosia\n";
		} else if (scores[0][i] < scores[1][i]) {
			cout << "Bajtek\n";
		} else {
			continue;
		}

		break;
	}
	
	written_by efindus in_2024;
}