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
#include <stdio.h>

int main()
{
	unsigned points[2] = {0};
	unsigned point_count[11][2] = {0};

	for (int who=0; who<2; ++who) {
		for (int i=0; i<18; ++i) {
			unsigned p;
			scanf("%u", &p);

			points[who] += p;
			point_count[p][who] += 1;
		}
	}

	if (points[0] > points[1]) {
		printf("Algosia\n");
		return 0;
	} else if (points[0] < points[1]) {
		printf("Bajtek\n");
		return 0;
	} else {
		for (int i_=0; i_<10; ++i_) {
			int i = 10 - i_;
			if (point_count[i][0] != point_count[i][1]) {
				if (point_count[i][0] > point_count[i][1]) {
					printf("Algosia\n");
				} else {
					printf("Bajtek\n");
				}
				return 0;
			}
		}
	}

	printf("remis\n");
	return 0;
}